ci: harden workflow install boundaries

- run non-test workflow installs with npm ci --ignore-scripts where lifecycle scripts are not needed\n- reject plain npm ci in workflows with write permissions\n- reject actions/cache in id-token: write workflows to reduce OIDC publish cache-poisoning risk
This commit is contained in:
Affaan Mustafa
2026-05-12 21:55:36 -04:00
committed by GitHub
parent 33db548be3
commit daf0355531
4 changed files with 52 additions and 2 deletions

View File

@@ -261,7 +261,7 @@ jobs:
node-version: '20.x'
- name: Install dependencies
run: npm ci
run: npm ci --ignore-scripts
- name: Run ESLint
run: npx eslint scripts/**/*.js tests/**/*.js

View File

@@ -33,7 +33,7 @@ jobs:
- name: Run security audit
run: |
if [ -f package-lock.json ]; then
npm ci
npm ci --ignore-scripts
npm audit --audit-level=high
else
echo "No package-lock.json found; skipping npm audit"