diff --git a/.github/workflows/cjs.yml b/.github/workflows/cjs.yml index e7a05561711..6d23498f3b4 100644 --- a/.github/workflows/cjs.yml +++ b/.github/workflows/cjs.yml @@ -50,6 +50,9 @@ jobs: - name: Install npm dependencies run: cd actions/setup/js && npm ci + - name: Check runtime CJS syntax + run: make check-cjs-syntax + - name: Run typecheck run: cd actions/setup/js && npm run typecheck diff --git a/Makefile b/Makefile index a246b46d3d6..6c772f401a9 100644 --- a/Makefile +++ b/Makefile @@ -231,6 +231,14 @@ security-govulncheck-sarif: @echo "✓ Govulncheck complete (results in govulncheck-results.sarif)" # Test JavaScript files +.PHONY: check-cjs-syntax +check-cjs-syntax: + @echo "→ Checking CommonJS runtime syntax..." + @find actions/setup/js \ + -path 'actions/setup/js/node_modules' -prune -o \ + -type f -name '*.cjs' ! -name '*.test.cjs' -print0 | xargs -0 -r -n1 node --check + @echo "✓ CommonJS runtime syntax validated" + .PHONY: test-js test-js: build-js cd actions/setup/js && npm run test:js -- --no-file-parallelism