Skip to content

ci: pin actions, scope token permissions, and scan workflows - #109

Merged
botandbang merged 1 commit into
mainfrom
bnb/workflow-hardening
Oct 23, 2026
Merged

botandbang merged 1 commit into
mainfrom
bnb/workflow-hardening

Conversation

@botandbang

Copy link
Copy Markdown
Contributor

Hardens every workflow ahead of turning on the repo setting that requires SHA-pinned actions.

Changed

  • Pinned actions/checkout, actions/setup-node and peter-evans/create-pull-request to the SHAs of their latest releases (v7.0.1, v7.1.0, v8.1.1), with the version in a trailing comment. release.yml was already pinned.
  • Every checkout sets persist-credentials: false. create-pull-request sets up its own auth, so the nightly still pushes.
  • Every workflow declares top-level permissions: contents: read for lint and test, {} where the jobs declare their own. This clears the 20 open CodeQL missing-workflow-permissions alerts.

Added

  • zizmor.yml runs zizmor on pushes to main and on PRs touching .github, and uploads findings to code scanning. .github/zizmor.yml turns off adhoc-packages, which flags every npm install because .npmrc sets package-lock=false.

Removed

  • publish-core, publish-fetchindex, publish-newest and publish-static. They published with NPM_TOKEN, which was created 2024-11-04 and is now deleted. release.yml published v1.1.0 of all eight packages over trusted publishing in this run.

Checked locally: actionlint, zizmor 1.31.1 with online audits (no findings), npm run lint.

Pin checkout, setup-node and create-pull-request to release SHAs, set
persist-credentials: false on every checkout, and give every workflow
top-level permissions. Add zizmor with adhoc-packages off, since
.npmrc sets package-lock=false. Remove the four NPM_TOKEN publish
workflows; release.yml publishes over trusted publishing.
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@botandbang
botandbang merged commit 9c05b29 into main Oct 23, 2026
8 checks passed
@botandbang
botandbang deleted the bnb/workflow-hardening branch October 23, 2026 22:37
@github-actions github-actions Bot mentioned this pull request Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants