chore: pin GitHub Actions to commit SHAs (incl. Node 24 bumps) - #64
Conversation
GitHub is deprecating the Node 20 runtime for Actions (runner default flips to Node 24 on 2026-06-16, Node 20 removed 2026-09-16). Bump the flagged actions to their latest majors, which migrate the runtime to Node 24. Verified against release notes: all are runtime-only bumps with no behavioral changes for our usage (the deprecated inputs/outputs/envs dropped by build-push v7 and setup-buildx v4 are not used here). - dorny/paths-filter v3 -> v4 - gitleaks/gitleaks-action v2 -> v3 - docker/setup-buildx-action v3 -> v4 - docker/build-push-action v6 -> v7 - docker/setup-qemu-action v3 -> v4 - docker/login-action v3 -> v4 - docker/metadata-action v5 -> v6 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe CI/CD workflow pins 15 GitHub Actions to specific commit SHAs, replacing floating major version references with immutable digests. The Semgrep job adds an explicit run step. All workflow job structure, triggers, environment variables, and build commands remain unchanged. ChangesCI/CD Action Version Pinning
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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)
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 |
Pin every action to a full-length commit SHA (with a "# vX.Y.Z" comment for Dependabot) to defend against mutable-tag supply-chain attacks -- e.g. a maintainer-account compromise re-pointing a tag at malicious code, as in the tj-actions/changed-files incident (March 2025). Only SHA-pinned consumers were unaffected there. The existing github-actions Dependabot config reads the version comments and keeps the SHAs updated, so there's no loss of automatic updates. Versions are unchanged from the prior commit: current majors are pinned, and cosign-installer intentionally stays on v3 (not upgraded to v4). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/ci-cd.yml (1)
80-153:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winFix CodeQL action tag label; Docker major-upgrade risk is unlikely
docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5(v4.1.0) anddocker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf(v7.2.0) are pinned to SHAs that match their tags; the key v4/v7 breaking changes called out include deprecatedDOCKER_BUILD_*envs/inputs, andci-cd.ymldoesn’t set anyDOCKER_BUILD_*values.github/codeql-action/upload-sarif@7211b7c8077ea37d8641b6271f6a365a22a5fbfadoesn’t match thev4.36.0tag object SHA; update the inline# v4.36.0label or repin to the tag commit.🤖 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/ci-cd.yml around lines 80 - 153, The workflow uses a SHA for github/codeql-action/upload-sarif that is mislabeled as "# v4.36.0"; update the reference so the inline comment matches the actual commit or repin the action to the official v4.36.0 tag (or replace the SHA with "v4.36.0") to resolve the mismatch; leave the docker/setup-buildx-action and docker/build-push-action pins as-is since their SHAs correspond to their v4/v7 labels and you are not using any deprecated DOCKER_BUILD_* inputs.
🤖 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.
Outside diff comments:
In @.github/workflows/ci-cd.yml:
- Around line 80-153: The workflow uses a SHA for
github/codeql-action/upload-sarif that is mislabeled as "# v4.36.0"; update the
reference so the inline comment matches the actual commit or repin the action to
the official v4.36.0 tag (or replace the SHA with "v4.36.0") to resolve the
mismatch; leave the docker/setup-buildx-action and docker/build-push-action pins
as-is since their SHAs correspond to their v4/v7 labels and you are not using
any deprecated DOCKER_BUILD_* inputs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ef7bb30e-2b49-4797-915d-d2196624622b
📒 Files selected for processing (1)
.github/workflows/ci-cd.yml
Summary
Two related CI hardening changes:
Bump flagged actions to Node 24 runtime majors — GitHub is deprecating the Node 20 runtime (runner default flips to Node 24 on 2026-06-16, Node 20 removed 2026-09-16). Bumped
paths-filterv3→v4,gitleaks-actionv2→v3, and thedocker/*family (build-pushv6→v7,setup-buildx/setup-qemu/loginv3→v4,metadatav5→v6). All verified as runtime-only bumps (no behavioral changes; the deprecated inputs/envs dropped by v7/v4 are not used here).Pin every action to a full commit SHA — protects against mutable-tag supply-chain attacks (a maintainer/account compromise re-pointing a tag at malicious code, cf. the
tj-actions/changed-filesincident, March 2025, where only SHA-pinned consumers were safe). Each pin carries a# vX.Y.Zcomment so the existing github-actions Dependabot config keeps the SHAs updated — immutability without losing auto-updates.All ~15 distinct actions (25
uses:lines) are now pinned, including GitHub-owned ones (checkout,codeql-action,setup-node) for a uniform, Scorecard-friendly policy.Notes
cosign-installerintentionally stays on v3 (not upgraded to v4 — out of scope for this PR).actions/cacheNode 20 warning comes from inside thedocker/*actions (not our YAML); it'll clear when Docker bumps their internal pin upstream.Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit