Provide GitHub Actions pinning and fix a bug - #49
Conversation
📝 WalkthroughWalkthroughThis PR updates GitHub Actions checkout settings, adds Dependabot and Zizmor policies, extends validation checks, and simplifies the Nix development shell and formatter configuration. ChangesCI workflow security and validation
Estimated code review effort: 2 (Simple) | ~12 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/zizmor.yml:
- Around line 1-5: The policy sets DeterminateSystems/*: ref-pin but CI
workflows still reference DeterminateSystems/flakehub-cache-action@main; update
either the policy or the workflows so they agree—either change the policy in
.github/zizmor.yml (remove or narrow the ref-pin rule for DeterminateSystems/*)
or pin all uses of DeterminateSystems/flakehub-cache-action@main in
.github/workflows/validate.yml and .github/workflows/workflow.yml to fixed refs
(tags/SHAs) instead of `@main` so the ref-pin policy is satisfied.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: cce2c785-7303-4791-aa66-ca5732c80674
⛔ Files ignored due to path filters (1)
flake.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
.github/dependabot.yml.github/workflows/validate.yml.github/workflows/workflow.yml.github/zizmor.ymlflake.nix
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/workflow.yml:
- Line 174: Replace the invalid github.repository.fork guard with
github.event.repository.fork in all four workflow conditions at the publish-step
gates, including the condition shown near the visibility and branch/tag checks,
so fork runs remain excluded.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c6c2e663-4cc2-4dc0-b1ec-4374f25bd9e4
📒 Files selected for processing (2)
.github/workflows/validate.yml.github/workflows/workflow.yml
`github.repository` is the `owner/repo` string, so `github.repository.fork`
was always null and `!null` always true — the guard on the publish steps
never blocked anything. Use `github.event.repository.fork` instead.
Add actionlint to the devshell and validate.yml to catch this class of bug:
action-validator only checks workflow YAML against its JSON schema and passes
the broken expression silently, while actionlint type-checks the contents of
`${{ }}` and flags dereferencing `.fork` on a string.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
actionlint fully covers action-validator's schema checking — misspelled keys, missing required sections, wrong scalar types — with clearer messages, and adds expression type checking on top. Keeping both is redundant; zizmor stays, since supply-chain posture is not actionlint's job. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Pins GitHub Actions to commit SHAs, adds Dependabot to keep those pins current, and adds
zizmorto check for unpinned actions andactionLintto catch thorny bugs going forward.Fixing the fork guard
The publish steps were gated on
!github.repository.fork. Butgithub.repositoryis theowner/repostring, so.forkwas always null and!nullalways true: the guard never blocked anything. All four steps now usegithub.event.repository.fork.It guards pushes, not PRs. On a
pull_requestfrom a fork,github.event.repositoryis the base repo, so.forkis false there too — fork PRs are stopped by thegithub.refcheck on the same line. What's newly covered is a push to a fork's ownmain.Why actionlint, and why
action-validatoris goneNeither of our existing checkers catches the bug above.
action-validatorvalidates workflow YAML against the SchemaStore JSON schema — it knowsif:must be a string, but can't reason about what's inside${{ }}, and exits clean on the broken file.zizmorcovers security posture, not expression correctness.actionlint type-checks expression contents against the real GitHub context types, and flags the broken guard on all four lines:
It also runs shellcheck over
run:blocks, pyflakes over inline Python, and validates action input/output names against each action's real metadata.action-validatoris dropped, not kept alongside. actionlint fully covers its remit. Given a workflow with a misspelledstpes:, a missingruns-on:, and a string where a number belongs, actionlint reports all three with clearer messages, e.g.:action-validatorreports the same file by dumping a raw RustValidationStatestruct, and finds nothing actionlint misses.zizmorstays. It and actionlint overlap on exactly one audit — script injection — and otherwise cover different ground. zizmor flagsunpinned-usesandartipacked, which actionlint is silent on; supply-chain posture isn't its job, and expression typing isn't zizmor's. That leaves two tools split cleanly between correctness and security.actionlint runs clean over both workflows today, with no shellcheck suppressions needed.
Summary by CodeRabbit