diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 1f1661c..5354f2b 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -129,11 +129,11 @@ jobs: with: persist-credentials: false - - uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 + - uses: github/codeql-action/init@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0 with: languages: ${{ matrix.language }} - - uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 + - uses: github/codeql-action/analyze@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0 with: category: "/language:${{matrix.language}}" diff --git a/Makefile b/Makefile index 5d53668..81f70a6 100644 --- a/Makefile +++ b/Makefile @@ -17,25 +17,23 @@ lint-fix: ## Execute linting and fix -e FIX_SHELL_SHFMT=true \ ) +setup: ## Install npm dependencies for all package.json files under actions/ + @echo "Installing npm dependencies for all packages..." + $(call run_npm_for_packages,install) + npm-audit-fix: ## Execute npm audit fix - @set -uo pipefail; \ - overall_status=0; \ - packages="$$(find actions -type f -name package.json -not -path '*/node_modules/*' -print | sort)"; \ - echo "Running npm audit fix for package.json files under actions/ ..."; \ - for pkg in $$packages; do \ - pkg_dir="$$(dirname "$$pkg")"; \ - echo "---"; \ - npm install --prefix "$$pkg_dir"; \ - echo "npm audit fix in $$pkg_dir"; \ - if ! npm --prefix "$$pkg_dir" audit fix; then \ - overall_status=1; \ - fi; \ - done; \ - exit $$overall_status + @echo "Running npm audit fix for all packages..." + $(call run_npm_for_packages,audit fix) + +test: ## Execute tests + @echo "Running tests for all packages..." + $(call run_npm_for_packages,test) ci: ## Execute CI tasks + $(MAKE) setup $(MAKE) npm-audit-fix $(MAKE) lint-fix + $(MAKE) test define run_linter DEFAULT_WORKSPACE="$(CURDIR)"; \ @@ -52,6 +50,21 @@ define run_linter $$LINTER_IMAGE endef +define run_npm_for_packages + @set -uo pipefail; \ + overall_status=0; \ + packages="$$(find actions -type f -name package.json -not -path '*/node_modules/*' -print | sort)"; \ + for pkg in $$packages; do \ + pkg_dir="$$(dirname "$$pkg")"; \ + echo "---"; \ + echo "npm $(1) in $$pkg_dir"; \ + if ! npm --prefix "$$pkg_dir" $(1); then \ + overall_status=1; \ + fi; \ + done; \ + exit $$overall_status +endef + ############################# # Argument fix workaround ############################# diff --git a/actions/get-matrix-outputs/action.yml b/actions/get-matrix-outputs/action.yml index b7b74e2..e5a3aa5 100644 --- a/actions/get-matrix-outputs/action.yml +++ b/actions/get-matrix-outputs/action.yml @@ -75,6 +75,6 @@ runs: } - if: ${{ inputs.remove-artifact == 'true' }} - uses: geekyeggo/delete-artifact@f275313e70c08f6120db482d7a6b98377786765b # v5.1.0 + uses: geekyeggo/delete-artifact@176a747ab7e287e3ff4787bf8a148716375ca118 # v6.0.0 with: name: ${{ steps.prepare-download.outputs.artifact-name }}-*