Provide GitHub Actions pinning#188
Conversation
📝 WalkthroughWalkthroughThis pull request systematically hardens the repository's GitHub Actions workflows by introducing security scanning, automating dependency updates, and pinning all action references to specific commit SHAs with minimal permissions. The changes span Dependabot configuration, a new Zizmor security workflow, and consistent updates across all CI workflows. ChangesSecurity Hardening via Action Pinning and Permissions
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
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.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/release-tags.yml (1)
52-52:⚠️ Potential issue | 🟠 Major | 🏗️ Heavy liftPin
DeterminateSystems/push-artifact-idsto a specific commit SHA for consistency.This workflow uses
DeterminateSystems/push-artifact-ids@main, while other DeterminateSystems actions in this repository are pinned to specific commit SHAs (e.g.,determinate-nix-action@bafaa638b9d5ec0e7e3ac1a7fc80453ef1fd265f). The same unpinned action also appears inrelease-prs.ymlandrelease-branches.yml. Pinning all DeterminateSystems actions to commit SHAs improves security by preventing unexpected changes from automatic action updates.🤖 Prompt for 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. In @.github/workflows/release-tags.yml at line 52, Replace the unpinned GitHub Action reference DeterminateSystems/push-artifact-ids@main with a specific commit SHA in this workflow (and do the same in release-prs.yml and release-branches.yml) to ensure reproducible runs; locate the uses entry "DeterminateSystems/push-artifact-ids@main" and change the tag portion to the chosen commit SHA (e.g., DeterminateSystems/push-artifact-ids@<commit-sha>) so the action is pinned.
🤖 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:
- Line 5: The policy entry "DeterminateSystems/*: ref-pin" is active but there
are remaining workflow references using unpinned refs (e.g.,
DeterminateSystems/*`@main`); update those workflow usages to use pinned refs
(commit SHAs, tags or specific release versions) or add explicit exemptions in
.github/zizmor.yml for the specific repo refs before enforcing ref-pin; search
for occurrences of "DeterminateSystems/*`@main`" in workflow files and replace
with the pinned ref or add an exemption rule alongside "DeterminateSystems/*:
ref-pin".
---
Outside diff comments:
In @.github/workflows/release-tags.yml:
- Line 52: Replace the unpinned GitHub Action reference
DeterminateSystems/push-artifact-ids@main with a specific commit SHA in this
workflow (and do the same in release-prs.yml and release-branches.yml) to ensure
reproducible runs; locate the uses entry
"DeterminateSystems/push-artifact-ids@main" and change the tag portion to the
chosen commit SHA (e.g., DeterminateSystems/push-artifact-ids@<commit-sha>) so
the action is pinned.
🪄 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: b55b4888-562f-4f8a-a7ff-9bb66b70b208
📒 Files selected for processing (10)
.github/dependabot.yml.github/workflows/build.yaml.github/workflows/check-and-test.yaml.github/workflows/flakehub.yaml.github/workflows/release-branches.yml.github/workflows/release-prs.yml.github/workflows/release-tags.yml.github/workflows/update-flake-lock.yaml.github/workflows/zizmor.yml.github/zizmor.yml
| unpinned-uses: | ||
| config: | ||
| policies: | ||
| DeterminateSystems/*: ref-pin |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find DeterminateSystems action usages that are not pinned to a full 40-char SHA.
rg -nP --type=yaml "uses:\s*['\"]?DeterminateSystems\/[^@]+@(?![0-9a-f]{40}\b)[^'\"\s]+" .github/workflows .github/zizmor.ymlRepository: DeterminateSystems/magic-nix-cache
Length of output: 1051
Pin or exempt remaining DeterminateSystems/*@main`` refs before enforcing ref-pin.
Line 5 enforces ref-pin for DeterminateSystems/*, but the following workflows include unpinned refs that create immediate policy violations:
.github/workflows/build.yaml:37.github/workflows/check-and-test.yaml:21, 28, 77.github/workflows/flakehub.yaml:19.github/workflows/release-branches.yml:60.github/workflows/release-prs.yml:63.github/workflows/release-tags.yml:52.github/workflows/update-flake-lock.yaml:18, 19
🤖 Prompt for 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.
In @.github/zizmor.yml at line 5, The policy entry "DeterminateSystems/*:
ref-pin" is active but there are remaining workflow references using unpinned
refs (e.g., DeterminateSystems/*`@main`); update those workflow usages to use
pinned refs (commit SHAs, tags or specific release versions) or add explicit
exemptions in .github/zizmor.yml for the specific repo refs before enforcing
ref-pin; search for occurrences of "DeterminateSystems/*`@main`" in workflow files
and replace with the pinned ref or add an exemption rule alongside
"DeterminateSystems/*: ref-pin".
Summary by CodeRabbit