Skip to content

ci: pin GitHub Actions to full commit SHAs - #1901

Merged
morluto merged 4 commits into
morluto:mainfrom
larinyo:pr/pin-actions-to-sha
Oct 13, 2026
Merged

morluto merged 4 commits into
morluto:mainfrom
larinyo:pr/pin-actions-to-sha

Conversation

@larinyo

@larinyo larinyo commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Every third-party uses: owner/repo@vN in .github/workflows is replaced with the 40-character commit SHA that the tag currently resolves to. The exact release is kept as a trailing comment (for example actions/checkout@11d5960a… # v4.4.0). Floating tags can be moved by whoever controls the action repository, and release.yml holds npm and MCP Registry publication credentials.

Change and scope

The pins, each checked with git ls-remote --tags; in every case vN^{} and vX.Y.Z^{} are the same commit:

Action Floating tag Pinned release Commit
actions/checkout v4 v4.4.0 11d5960a326750d5838078e36cf38b85af677262
actions/checkout v6 v6.1.0 d23441a48e516b6c34aea4fa41551a30e30af803
actions/setup-node v4 v4.4.0 49933ea5288caeca8642d1e84afbd3f7d6820020
actions/setup-node v6 v6.5.0 249970729cb0ef3589644e2896645e5dc5ba9c38
actions/upload-artifact v4 v4.6.2 ea165f8d65b6e75b540449e92b4886f43607fa02
actions/download-artifact v4 v4.3.0 d3f86a106a0bac45b974a628896c90dbdf5c8093
actions/setup-dotnet v4 v4.3.1 67a3573c9a986a3f9c594539f4ab511d57bb3ce9
actions/setup-python v5 v5.6.0 a26af69be951a213d495a4c3e4e4022e16d87065
actions/configure-pages v5 v5.0.0 983d7736d9b0ae728b81ab479565c72886d7745b
actions/upload-pages-artifact v4 v4.0.0 7b1f4a764d45c48632c6b24a0339c27f5614fb0b
actions/deploy-pages v4 v4.0.5 d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e
googleapis/release-please-action v4 v4.4.1 5c625bfb5d1ff62eadeeb3772007f7f66fdcf071
cloudflare/wrangler-action v4 v4.1.3 953926a2e2182532811c01a25e53647d93bf07c0
reactivecircus/android-emulator-runner (was 4c44018e…, the annotated v2 tag object) v2.38.0 a421e43855164a8197daf9d8d40fe71c6996bb0d
  • android-emulator-runner was already pinned, but to the SHA of the annotated tag object (refs/tags/v2), not to the commit (refs/tags/v2^{}). Actions resolves both. Only the commit SHA can be compared against the release, and some tooling (Dependabot, pin checkers) does not treat tag-object SHAs as pins.
  • tests/conformance/providers/ghidra/realGhidraWindowsWorkflow.test.ts now requires SHA-pinned setup-node and upload-artifact in the Windows Ghidra workflow.
  • The pins were applied to the current workflows on main, including the shard and cache changes in 40b37ae and the website workflow from a2d3338. Local reusable workflows (./.github/workflows/*.yml) are unchanged. No job conditions, permissions or steps change.

Contract and boundary impact

  • CI only. No package, runtime or contract impact.

Evidence and regression coverage

  • Tests updated: realGhidraWindowsWorkflow.test.ts.
  • Check: no uses: line outside local workflows lacks a @<40-hex> # vX.Y.Z pin.

Validation performed

  • actionlint v1.7.7 with -shellcheck= -pyflakes= (the same flags as CI): no findings.
  • YAML parse of all 18 workflow files (yaml package): OK.
  • npx vitest run tests/boundary/filesystem/ciChangeScope.test.ts tests/boundary/filesystem/releaseCheckpoint.test.ts tests/boundary/filesystem/releaseWorkflow.test.ts tests/conformance/providers/ghidra/realGhidraWindowsWorkflow.test.ts: 130 passed.
  • npx vitest run tests/process-global/curatedWindowsLane.test.ts: 2 passed.
  • npx oxlint: 0 errors. npm run format: no changes.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Future action updates need a SHA bump. Dependabot's github-actions ecosystem understands @sha # vX.Y.Z comments, if maintainers want it.
  • Real CI coverage: these workflows did not run on GitHub as part of this change.
  • Security review: this reduces the supply-chain exposure of the release and publication jobs.

Limits / not verified

  • No GitHub-hosted run of the pinned workflows.

Replace every third-party `uses: owner/repo@vN` reference in
.github/workflows with the 40-character commit SHA that the tag
currently resolves to, keeping the exact release as a trailing comment.
Each pin was checked with `git ls-remote --tags`: the floating major tag
and the commented release dereference to the same commit. Local
reusable workflows are unchanged.

Re-pin reactivecircus/android-emulator-runner from the SHA of the
annotated `v2` tag object (4c44018e) to the commit it points to
(a421e438, v2.38.0); Actions resolves both, but only the commit SHA is
an immutable reference that tooling can compare with the release.

Update the Windows Ghidra workflow trust-boundary test to require
SHA-pinned setup-node and upload-artifact references instead of the
previous floating tags.

Validation: actionlint v1.7.7 (-shellcheck= -pyflakes=, as in CI), YAML
parse of all workflows, no remaining unpinned third-party `uses:`, and
the workflow boundary/conformance tests.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T12:14:33.318476Z c7e8a7b New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Resolved the ci.yml conflict by taking upstream's new workflow and
re-pinning every action reference to the same full commit SHAs used on
this branch. Also pinned the action references upstream added since
the branch point: actions/cache and actions/cache/restore v4.3.0 in the
portable-build-cache composite action, and actions/checkout,
actions/setup-node and actions/setup-go v5.6.0 in real-go-binary.yml.
Nothing was superseded; upstream still uses floating tags.
@larinyo

larinyo commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Merged current main and resolved the ci.yml conflict by re-applying the same SHA pins to upstream's new workflow. I also pinned the actions main added since this PR opened: actions/cache and cache/restore in the new portable-build-cache composite action, and setup-go, checkout and setup-node in real-go-binary.yml. No unpinned remote uses: remain and the workflow tests pass.

@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

@greptileai review

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[High impact] The changes reviewed here appear safe to merge.

Summary

Pins third-party GitHub Actions to full commit SHAs and updates workflow tests to accept those pins.

  • GitHub workflows now run third-party actions from fixed commits.

Reviews (3) · Last reviewed commit: "style(ci): format action identity assert..." · Reviewed by Greptile

Retained current main workflows and cache guards while pinning every external action to a full SHA, including new main workflows.

Source inspection and git diff --check. Further tests/typechecks/builds skipped by explicit user instruction; canceled validations are not passes.
Retain formatting edits produced before the user stopped validation.

Source inspection and git diff --check only. Tests, builds and typechecks skipped by explicit user request. GitHub review writes paused globally.
@morluto
morluto merged commit c6503ed into morluto:main Oct 13, 2026
9 checks passed
@morluto morluto added the area: build Build, CI, packaging, and publishing label Oct 14, 2026
GovinduSasanka added a commit to GovinduSasanka/rea that referenced this pull request Oct 14, 2026
morluto#1901 pinned every external action to a commit SHA, but real-cutter.yml
later reintroduced actions/upload-artifact@v4 and
actions/download-artifact@v4. A moved tag would change the code that runs
in CI. Pin those references to the SHAs used elsewhere in the repository
and add a boundary test that fails on any external action not pinned to a
full commit SHA, so the regression cannot recur unnoticed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, packaging, and publishing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants