Skip to content

fix(ci): pin GitHub Actions to commit SHAs instead of mutable version tags - #2350

Merged
carlos-alm merged 1 commit into
mainfrom
fix/issue-2170-pin-actions-sha
Aug 8, 2026
Merged

carlos-alm merged 1 commit into
mainfrom
fix/issue-2170-pin-actions-sha

Conversation

@carlos-alm

Copy link
Copy Markdown
Contributor

Summary

Closes #2170

Every uses: line across the 12 remaining workflows referenced a mutable major/minor version tag (actions/checkout@v7.0.1, actions/setup-node@v7.0.0, dtolnay/rust-toolchain@stable, Swatinem/rust-cache@v2, actions/cache@v6, actions/upload-artifact@v4/v7, actions/download-artifact@v4/v8, actions/setup-python@v7, actions/setup-go@v7, actions/github-script@v9, contributor-assistant/github-action@v2.6.1). If any of these tags is ever repointed (upstream compromise or accidental force-push), the next CI run executes unreviewed code with whatever permissions that job holds. update-recall-floors.yml already followed the safe pattern; everything else didn't.

Fix

Resolved the exact commit SHA each tag currently points to (via gh api repos/<owner>/<repo>/git/refs/..., dereferencing annotated tag objects where needed) and pinned every uses: line to <sha> # <tag>, matching update-recall-floors.yml's existing style. anthropics/claude-code-action in claude.yml was already SHA-pinned. .github/dependabot.yml already has a github-actions ecosystem entry on a weekly schedule, so these pins will get automatic bump PRs going forward — no new Dependabot config needed.

Local (./.github/workflows/...) and reusable-workflow (workflow_call) references are untouched — same-repo refs move with the branch, so pinning them would just be noise.

Test plan

  • python3 -c "import yaml; ..." — all 14 workflow files parse as valid YAML.
  • actionlint .github/workflows/*.yml — byte-identical warning output (249 lines) before and after this change on every file; introduces zero new findings, fixes zero unrelated ones (all pre-existing warnings are shellcheck notes on run: scripts, out of scope here).
  • Verified two of the resolved SHAs (actions/checkout@v7.0.1, actions/setup-node@v7.0.0) exactly match the SHAs already committed in update-recall-floors.yml.

… tags

Closes #2170

Every uses: line across the 12 remaining workflows referenced a mutable
major/minor version tag (actions/checkout@v7.0.1, actions/setup-node@v7.0.0,
dtolnay/rust-toolchain@stable, Swatinem/rust-cache@v2, actions/cache@v6,
actions/upload-artifact@v4/v7, actions/download-artifact@v4/v8,
actions/setup-python@v7, actions/setup-go@v7, actions/github-script@v9,
contributor-assistant/github-action@v2.6.1). If any of these tags is ever
repointed (upstream compromise or accidental force-push), the next CI run
executes unreviewed code with whatever permissions that job holds.

Pinned every uses: line to the exact commit SHA the tag currently resolves
to (resolved via `gh api repos/<owner>/<repo>/git/refs/...`), each with a
trailing `# <tag>` comment for human readability, matching the pattern
update-recall-floors.yml already used. anthropics/claude-code-action was
already SHA-pinned. dependabot.yml already has a github-actions ecosystem
entry, so these pins will get automatic bump PRs going forward.

Verified with actionlint: identical warning set before and after (249
lines, byte-for-byte same content) — this change introduces zero new
findings and fixes zero unrelated ones.
@greptile-apps

greptile-apps Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR hardens GitHub Actions supply-chain security by replacing mutable third-party action tags with immutable commit SHAs while retaining version comments for maintainability.

  • Pins checkout, language setup, caching, and artifact actions across CI, benchmark, publishing, and compliance workflows.
  • Pins third-party Rust, CLA, and GitHub scripting actions.
  • Preserves existing workflow configuration, inputs, permissions, and job behavior.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete regressions identified in the action-pinning changes.

The changes consistently replace mutable action references with syntactically valid immutable revisions while preserving workflow inputs, conditions, permissions, and behavior.

Important Files Changed

Filename Overview
.github/workflows/ci.yml Replaces mutable action tags throughout the primary CI workflow with consistently formatted commit pins.
.github/workflows/publish.yml Pins checkout, toolchain, artifact, and language setup actions across build, validation, and publishing jobs without changing their inputs.
.github/workflows/benchmark.yml Pins checkout, artifact, cache, and Node setup actions used by benchmark collection and processing.
.github/workflows/cla.yml Pins the privileged CLA assistant action to an immutable revision.
.github/workflows/codegraph-impact-comment.yml Pins cross-workflow artifact download and PR-comment scripting actions while preserving required permissions.

Reviews (1): Last reviewed commit: "fix(ci): pin GitHub Actions to commit SH..." | Re-trigger Greptile

@carlos-alm
carlos-alm merged commit 45c3503 into main Aug 8, 2026
26 checks passed
@carlos-alm
carlos-alm deleted the fix/issue-2170-pin-actions-sha branch August 8, 2026 09:12
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pin GitHub Actions to commit SHAs instead of mutable version tags repo-wide

1 participant