Skip to content

fix(ci): guard stale npm script approvals - #4381

Closed
mikemikimike wants to merge 1 commit into
apache:mainfrom
mikemikimike:fix/ci-guard-stale-allow-scripts
Closed

mikemikimike wants to merge 1 commit into
apache:mainfrom
mikemikimike:fix/ci-guard-stale-allow-scripts

Conversation

@mikemikimike

Copy link
Copy Markdown
Contributor

Summary

The root allowScripts policy uses exact name@version keys, so dependency bumps can silently turn reviewed approvals into entries that match nothing. This leaves npm ci successful while skipping install scripts without a repository check identifying the stale policy.

This change:

  • updates the two stale approvals to the versions present in package-lock.json;
  • adds an install-free check:allow-scripts gate that validates every approval against the lockfile, including nested packages;
  • runs the gate and its regression tests in CI.

The deny-by-default policy remains unchanged; packages without an explicit approval remain denied.

Validation

  • npm ci --no-audit --no-fund
  • npm run check:allow-scripts
  • node --test --test-concurrency=1 scripts/check-allow-scripts.test.mjs
  • npm run build
  • npm run format:check
  • npm run lint
  • npm run check:asf-headers
  • npm run check:asf-npm
  • git diff --check

The repository-wide typecheck and npm test commands were also run. They report existing failures in untouched desktop, storage, CLI, evaluation, and Windows-specific PTY paths; the changed files pass their focused checks and the full build succeeds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant