ci: add zizmor static analysis and harden existing workflows#39
Conversation
Adds a Zizmor workflow that runs on PRs touching workflow definitions
and uploads SARIF results to the GitHub Security tab. Addresses every
finding reported on the existing workflows so the new check lands green:
- Pin all third-party and first-party action references to commit
SHAs (with version comments) — eliminates `unpinned-uses` errors
- Move templated `${{ inputs.* }}` and `${{ steps.*.outputs.* }}`
expansions in `run:` blocks behind env vars — eliminates
`template-injection` errors in ci.common.yml and publish.yml
- Add workflow- and job-level `permissions:` blocks scoped to the
minimum each job needs — eliminates `excessive-permissions` warnings
- Add `persist-credentials: false` to checkouts that don't push back
to the repo — eliminates `artipacked` findings (the publish job's
release checkout intentionally keeps credentials so it can push
version bumps and tags)
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The previous SHA pointed at v3.32.0's annotated tag object, not the commit it points to. zizmor's impostor-commit audit couldn't resolve it via the GitHub API and emitted a fast-path warning. Use the peeled commit SHA so the impostor check resolves cleanly.
|
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. |
Two issues with the CI workflow surfaced on this PR:
1. The reusable `ci.common.yml` declares `permissions: contents: read`
on its build job, but the calling `build` job in `ci.yml` had no
`permissions:` block. Combined with the workflow-level
`permissions: {}` added in #39, the caller could not grant the
permissions the reusable workflow needs, so every CI run since #39
has been a `startup_failure` with zero jobs scheduled. Grant
`contents: read` on the caller job so the reusable workflow can run.
2. `PATH_TO_NAME` in `changed-files-job` enumerated every workspace
package except `packages/journeys`, so PRs touching only journeys
produced an empty `packages` output and skipped the build matrix
entirely. Add the missing entry.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
.github/workflows/zizmor.yml) that runs static analysis on GitHub Actions whenever workflow definitions change, and uploads SARIF results to the repo's Security tab.What changed in existing workflows
unpinned-usesactions/*,github/*,astral-sh/*,dorny/paths-filter,fastify/github-action-merge-dependabot) are now pinned to commit SHAs with version comments, matching the convention already used fortj-actions/changed-files.template-injection${{ inputs.package_name }}(inci.common.yml) and${{ steps.filter.outputs.changes }}(inpublish.yml) no longer expand directly into shellrun:blocks — they're routed throughenv:and read as"$VAR". Same treatment for${{ matrix.shell }}inci.yml.excessive-permissionspermissions: {}plus job-level minimum permissions (contents: read,pull-requests: read, etc.) added to every workflow that was relying on the default token permissions.artipackedpersist-credentials: falseadded to allactions/checkoutinvocations except thepublish.ymlrelease job, which intentionally keeps credentials so it can push the version-bump commit and tags.Verification
Local run with the version Zizmor will use in CI:
Test plan
Zizmorjob passesactions/checkout,actions/setup-node,actions/upload-artifactSHAs resolve to the documented version tagslint,examples,examples-e2e,catalog-e2e, andbuildjobs still pass with the newpermissions:blocks (read-only is sufficient for npm install + build + test)publish.ymlrelease path still pushes commits/tags (its checkout retainspersist-credentials: true)Generated by Claude Code