Skip to content

chore(ci): pin every third-party GitHub Action to a commit SHA - #1587

Merged
HuiJun merged 3 commits into
developfrom
chore/pin-github-actions
Oct 27, 2026
Merged

HuiJun merged 3 commits into
developfrom
chore/pin-github-actions

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Of the 140 third-party uses: references under .github/ and in the root action.yml, 98 floated on a mutable tag (actions/checkout@v4, actions/setup-go@v5, actions/upload-artifact@v4, …). A re-pointed tag changes what a build runs without any change in this repository, which is the cheapest unfixed hole in the build environment. Each floating reference now names the exact commit its tag resolves to today, with the release that commit is as a trailing comment (actions/checkout@11d5960a… # v4.4.0) — the form Dependabot's github-actions ecosystem reads to move a pin (its config is a sibling change, not part of this PR). No version moves: every workflow keeps running the commit it ran yesterday, and the 42 references that were already SHA-pinned are untouched. Local actions (./, ./.github/actions/corpora) are unchanged.

action tag refs commit resolves to
actions/checkout v4 29 11d5960a326750d5838078e36cf38b85af677262 v4.4.0
actions/setup-go v5 13 40f1582b2485089dde7abd97c1529aa768e1baff v5.6.0
actions/setup-node v4 13 49933ea5288caeca8642d1e84afbd3f7d6820020 v4.4.0
actions/upload-artifact v4 12 ea165f8d65b6e75b540449e92b4886f43607fa02 v4.6.2
actions/cache v4 11 0057852bfaa89a56745cba8c7296529d2fc39830 v4.3.0
actions/download-artifact v4 9 d3f86a106a0bac45b974a628896c90dbdf5c8093 v4.3.0
actions/setup-java v4 6 cf277c60eb25467037889841efdb72551f06f6c3 v4.9.1
actions/setup-python v5 5 a26af69be951a213d495a4c3e4e4022e16d87065 v5.6.0
actions/cache/restore v4 3 0057852bfaa89a56745cba8c7296529d2fc39830 v4.3.0
actions/cache/save v4 2 0057852bfaa89a56745cba8c7296529d2fc39830 v4.3.0
actions/configure-pages v5 1 983d7736d9b0ae728b81ab479565c72886d7745b v5.0.0
actions/upload-pages-artifact v3 1 56afc609e74202658d3ffba0e8f6dda462b719fa v3.0.1
actions/deploy-pages v4 1 d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e v4.0.5
github/codeql-action/upload-sarif (root action.yml) v4 1 9b3254085494b55a0f7c4c2b3d2d52cc712ce370 v4.39.1 (annotated tag, dereferenced)

Pre-existing pins, untouched and re-verified (tag still dereferences to the pinned commit): actions/checkout v5.0.0 ×7, actions/setup-go v6.0.0 ×3, actions/setup-node v5.0.0 ×2, actions/setup-python v7.0.0 ×1, actions/upload-artifact v7.0.1 ×3, actions/download-artifact v8.0.1 ×3, softprops/action-gh-release v2.3.3, signpath/github-action-submit-signing-request v2.3, pypa/gh-action-pypi-publish v1.14.2, sigstore/cosign-installer v4.1.2, julia-actions/setup-julia v2.7.0. So six actions carry two pins (the major each workflow already used); bringing the v4/v5 majors up to the v5–v8 ones nightly.yml and release-windows.yml run is a behaviour change (Node 24 runtime, new caching defaults) and is left to Dependabot.

The secret-carrying and deploying workflows (mcp-registry.yml, release-windows.yml, pages.yml) have no floating reference left; release-windows.yml and mcp-registry.yml were already fully pinned and are unchanged. validate-action.yml keeps validating the root action.yml; its own checkout/setup-go steps are pinned.

CONTRIBUTING.md § GitHub Actions gains one paragraph stating the pin form for new steps. Changelog fragment: changes/unreleased/pin-github-actions.security.md.

How it was verified

  • Resolution: gh api repos/<o>/<r>/git/ref/tags/<tag> per floating tag (annotated tags dereferenced via git/tags/<sha>), then git/matching-refs/tags/<tag>. to name the release tag at the same commit.
  • Every pin, new and pre-existing (25 distinct): gh api repos/<o>/<r>/commits/<sha> resolves, and the tag in the comment dereferences to exactly that commit — 25/25 identical.
  • grep -rn "uses:.*@v[0-9]" .github action.yml — no floating reference left; git diff origin/develop --stat -- .github action.yml is 107 one-line substitutions, nothing else.
  • actionlint v1.7.12 (not in CI): the same two pre-existing shellcheck style notes in pr.yml before and after, no new findings.
  • go build ./..., go vet ./..., gofmt -l . (empty), go test ./tests/hygiene, python3 scripts/changelog.py check, scripts/ci-changed-areas-test.sh — all pass.

Maintainer follow-ups

  • Dependabot github-actions config (sibling PR) is what moves these pins from here on.

Checklist

  • make test and make lint pass locally (workflow/docs-only change; go build, go vet, gofmt -l, tests/hygiene, changelog.py check, ci-changed-areas-test.sh, actionlint run)
  • Tests added or updated for the change (none: configuration pins, verified by resolution against the GitHub API)
  • Documentation extended where it already covers the surface (see CONTRIBUTING.md)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (no gate count moved)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/1cea005c16fa42d99890499890498fba
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/1cea005c16fa42d99890499890498fba?variant=devin
Requested by: @HuiJun

Replace the 98 uses: references that floated on a mutable tag with the full
commit of a verified release and the version as a trailing comment, one pin
per action across the workflows and the composite actions. The pins that
already existed move to the same release where they were behind it.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review October 27, 2026 19:00
@HuiJun
HuiJun merged commit f6e4ca7 into develop Oct 27, 2026
58 checks passed
@HuiJun
HuiJun deleted the chore/pin-github-actions branch October 27, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant