Harden CI: pin gate/guard/quarantine workflow actions to commit SHAs - #5283
Merged
Conversation
Replaces the floating major-version tags in the nine PR-gate, guard and quarantine workflows with the full commit SHA of the release they already resolve to, keeping the version as a trailing comment. actions/checkout@v7 -> 3d3c42e5... # v7.0.1 actions/setup-python@v7 -> 5fda3b95... # v7.0.0 actions/setup-node@v7 -> 82076278... # v7.0.0 actions/upload-artifact@v7 -> 043fb46d... # v7.0.1 Files: apply-required-checks, c6-pr-gate, c6-schedule-heal, e2e-gate, product-record-gate, auth-bootstrap-guard, auto-quarantine, quarantine-sweep, harness-observability-audit. A floating tag is mutable: whoever controls the upstream repository can repoint it at a different commit, and the next run of these workflows would fetch that commit without any change landing here. These nine gate the merge queue, so they run on untrusted pull requests. Pinning to a SHA means an upgrade is a reviewed diff. The four SHAs are the ones this repository already pins in ci.yml, supply-chain.yml and the release workflows from the earlier batches, so this introduces no new upstream code -- it makes these files agree with the ones already pinned. 17 refs, 1:1 replacements, no other change. All 34 files under .github/workflows/ re-parsed with yaml.safe_load afterwards, and each changed file was diffed as a loaded structure against HEAD to confirm the only difference is the `uses:` values. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015Uyc5F1U4k6AiufL2JEFz6
✅ Drift Bot (ClawMetry): no drift detectedDrift Bot analyzed the changed files against this project's blueprints and requirements and found no drift. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Continues the
PinnedDependenciesbatches (afterci.yml#5275,supply-chain.yml#5276, the conformance/install/handoff set #5279, and the release pipeline #5281) with the nine PR-gate, guard and quarantine workflows. 17 refs, all 1:1 replacements of a floating major tag with the full commit SHA plus a version comment.actions/checkout@v73d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1actions/setup-python@v75fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0actions/setup-node@v7820762786026740c76f36085b0efc47a31fe5020 # v7.0.0actions/upload-artifact@v7043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1Files:
apply-required-checks.yml,c6-pr-gate.yml,c6-schedule-heal.yml,e2e-gate.yml,product-record-gate.yml,auth-bootstrap-guard.yml,auto-quarantine.yml,quarantine-sweep.yml,harness-observability-audit.yml.Why
A floating tag is mutable. Whoever controls the upstream repository can repoint
@v7at a different commit, and the next run of these workflows fetches that commit with no change landing here and nothing to review. That is the ScorecardPinnedDependenciesclass.These nine are worth doing as one batch because of what they are: they gate the merge queue, so they run against pull requests the repository does not control. A workflow that decides whether other changes may merge is a poor place to keep a mutable dependency.
Why these four SHAs
They are not newly resolved — they are the values this repository already pins in
ci.yml,supply-chain.ymland the release workflows from the four earlier batches, all of which are green onmain. So this adds no upstream code that is not already running here; it makes these nine files agree with the ones already pinned, and keeps a single SHA per action across the repo so the next bump is one sweep.Risk
uses:values only. Nopermissions:block, step, trigger, matrix, runner orrun:body is touched, and no action's version changes — only how it is addressed.Verification:
.github/workflows/re-parsed withyaml.safe_loadafter the edit;HEADversion withuses:values masked — the diff is empty, confirming the change is pins and nothing else;git diff --statis 17 insertions / 17 deletions across 9 files.Not in this PR
Fifteen workflows still carry floating refs and belong in later batches, split by family. Three of them need a SHA that is not yet established anywhere in this repo and so want their own look rather than a sweep:
browserstack.ymlreferencesbrowserstack/github-actions/*@master— a branch, not even a tag, so it is the weakest ref in the repo and deserves its own PR;i18n-autotranslate.yml/i18n-docs-autotranslate.ymlusepeter-evans/create-pull-request@v8, a third-party action that opens PRs;overhead-bench.yml/windows-enterprise-tls.ymlpinactions/setup-python@v6andsupply-chain.ymlhas onegithub/codeql-action/upload-sarif@v3left.Also out of scope:
TokenPermissionsis now clean on this repo — all 34 workflows declare a top-levelpermissions:block — and norun:block interpolates${{ github.event.* }}.Product record
CI-only: every changed path is under
.github/, which is exempt from the product-record gate.No-PRD: CI/workflow-only change, all paths under
.github/(gate-exempt).Generated by Claude Code