Repository navigation
ci: add zizmor workflow and harden GitHub Actions workflows - #1829
arthurschreiber wants to merge 3 commits into
Conversation
Run zizmor via zizmorcore/zizmor-action on pushes and pull requests. Findings are uploaded to code scanning rather than failing the job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019tyi7LR4AMma656aM8XYso
- Pin all third-party and first-party actions to commit SHAs, with the matching version tag in a trailing comment. - Set `persist-credentials: false` on every `actions/checkout` step. semantic-release authenticates via `GITHUB_TOKEN` itself, so the pre-release job does not need the persisted credentials. - Restrict `GITHUB_TOKEN` permissions in the Node CI and PR title lint workflows to what they need. - Keep `pull_request_target` for the PR title lint so it still runs on fork PRs, and document why it's safe (no PR code is checked out). - Drop the `npm install -g npm@latest` step from the release workflow. The bundled npm handles `npm info` and `npm dist-tag add`, and the `jq` normalization already copes with both output formats. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019tyi7LR4AMma656aM8XYso
Keep the SHA-pinned actions up to date with a weekly, grouped update. Use a `ci` commit prefix so Dependabot's PR titles pass the title lint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019tyi7LR4AMma656aM8XYso
|
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:
For more information about GitHub Code Scanning, check out the documentation. |
There was a problem hiding this comment.
🟢 Approval recommended
The action pins were verified, configuration checks pass, and no unresolved correctness or security issues were found.
0 open findings
What changed in this PR
Adds automated GitHub Actions security auditing and hardens existing CI workflows.
Changes:
- Adds zizmor scanning and grouped Dependabot updates.
- Pins third-party actions and disables persisted checkout credentials.
- Restricts workflow permissions and removes unnecessary npm upgrading.
| File | Description |
|---|---|
.github/workflows/zizmor.yml |
Adds workflow security scanning. |
.github/workflows/release.yml |
Hardens checkout and simplifies npm usage. |
.github/workflows/nodejs.yml |
Pins actions and restricts permissions. |
.github/workflows/lint-pull-request-title.yml |
Limits permissions and documents trigger safety. |
.github/workflows/codeql-analysis.yml |
Pins CodeQL and checkout actions. |
.github/workflows/claude.yml |
Pins actions and hardens checkout. |
.github/workflows/claude-code-review.yml |
Pins actions and hardens checkout. |
.github/dependabot.yml |
Automates grouped action-pin updates. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1829 +/- ##
==========================================
+ Coverage 84.49% 84.76% +0.27%
==========================================
Files 96 96
Lines 4720 4720
Branches 884 884
==========================================
+ Hits 3988 4001 +13
+ Misses 468 455 -13
Partials 264 264 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Adds a zizmor workflow to audit our GitHub Actions setup, fixes everything it currently reports, and adds a Dependabot config so the hash-pinned actions stay current.
New zizmor workflow
.github/workflows/zizmor.ymlrunszizmorcore/zizmor-actionon pushes to the release branches and on all pull requests. Findings go to code scanning (the Security tab). The job fails only if zizmor itself errors, not when it reports findings. To make findings block merges, add a code scanning rule to the branch ruleset..gitignoreignores every dotfile (.*), which also covers.github/. zizmor respects.gitignore, so with its default input (.) it finds nothing to scan and errors out. The workflow therefore passesinputs: .githubexplicitly.Fixes to existing workflows
uses:now points at a commit SHA, with the version in a trailing comment. Each SHA is the commit the old major tag pointed to, so the action code doesn't change, with one exception:claude.ymlandclaude-code-review.ymlwere onactions/checkout@v4and now use v6.1.0 like the other workflows.persist-credentials: falseon every checkout. semantic-release logs in withGITHUB_TOKENitself, so the pre-release job doesn't need the token that checkout would otherwise leave in the git config.nodejs.yml:contents: readfor the whole workflow. Thepre-releasejob keeps its own explicit permissions.lint-pull-request-title.yml: no permissions by default, and the job getspull-requests: read.pull_request_targetin the PR title check: kept so the check still runs on PRs from forks, which plainpull_requestdoesn't support for this action. The job never checks out or runs PR code, so I suppressed zizmor'sdangerous-triggersfinding with an inline comment that says so.release.yml: removed thenpm install -g npm@lateststep. The job only runsnpm infoandnpm dist-tag add, which the npm bundled with Node 22 handles, and thejqnormalization from ci: handle array output fromnpm info --jsonin release workflow #1793 already copes with bothnpm infooutput formats.Dependabot
.github/dependabot.ymlchecks thegithub-actionsecosystem weekly, groups all updates into one PR, and waits 7 days after a release before proposing it. It uses acicommit prefix so Dependabot's PR titles pass the title lint.Testing
zizmor .github(v1.30.1, offline) reports no findings. Online audits couldn't run from my environment. This PR's zizmor run will cover them.dependabot.ymlparse as valid YAML.🤖 Generated with Claude Code
https://claude.ai/code/session_019tyi7LR4AMma656aM8XYso
Generated by Claude Code