Harden CI: pin the remaining third-party actions to commit SHAs - #5285
Merged
Merged
Conversation
Every action reference in this repository that is not owned by the `actions/` org still resolved through a mutable ref. Three of them pointed at a branch: browserstack/github-actions/setup-env@master browserstack/github-actions/setup-local@master (x2) peter-evans/create-pull-request@v8 (x2) github/codeql-action/upload-sarif@v3 A branch or floating tag is repointable by whoever controls the upstream repository, so the code these workflows execute can change with nothing landing here and nothing to review. This replaces each with the full commit SHA it resolves to today, plus a version comment. No action's version changes -- only how it is addressed. The four `actions/checkout` / `actions/setup-python` refs in the same files are pinned to the SHAs this repo already uses everywhere else, so one SHA per action holds across all 34 workflows. Verified: every file under .github/workflows/ re-parsed with yaml.safe_load; each changed file compared against HEAD as a parsed structure with `uses:` values masked, and the diff is empty; each new SHA fetched from its upstream repository to confirm it is a real commit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LMbwMnwYkoSjZ62Zo7J9ec
✅ Drift Bot (ClawMetry): no drift detectedDrift Bot analyzed the changed files against this project's blueprints and requirements and found no drift. |
4 tasks
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
The last
PinnedDependenciesbatch that is not anactions/-org action. Six references across four files, each a 1:1 replacement of a mutable ref with the full commit SHA it resolves to today, plus a version comment.browserstack/github-actions/setup-env@master1ab56d9521ce20f4651bb5d9f3ef39c5ba54805a # master @ 2026-08-28browserstack/github-actions/setup-local(×2)@master1ab56d9521ce20f4651bb5d9f3ef39c5ba54805a # master @ 2026-08-28peter-evans/create-pull-request(×2)@v85f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1github/codeql-action/upload-sarif@v36f5948dfacef28e207b48d0905cf90c03365536d # v3.37.9Files:
browserstack.yml,i18n-autotranslate.yml,i18n-docs-autotranslate.yml,supply-chain.yml.The four
actions/checkout@v7/actions/setup-python@v7refs sitting in the same files are pinned in the same pass, to the SHAs this repository already uses inci.yml,supply-chain.ymland the release workflows. That keeps one SHA per action across all 34 workflows, so the next bump stays a single sweep.Why this set, and why now
#5283 called these out as the batch that wanted its own look rather than a sweep, because unlike the earlier batches these are not first-party actions and three of them did not even resolve through a tag.
A branch ref is the weakest thing a workflow can depend on.
@masteris whatever BrowserStack pushed most recently — the code executed by the next run can change with nothing landing in this repository and nothing to review.@v8and@v3are floating major tags, repointable the same way, just more slowly. That is the ScorecardPinnedDependenciesclass, and it matters more here than for a first-party action because these are third-party repositories with their own release practices.Two of the six are also unusually well-placed to do damage if the upstream ref moved:
peter-evans/create-pull-requestruns with the token that opens pull requests against this repository, and the BrowserStack steps receiveBROWSERSTACK_USERNAME/BROWSERSTACK_ACCESS_KEY.Why these SHAs
Each was resolved directly from the upstream repository and then verified by fetching the commit:
peter-evans/create-pull-request—refs/tags/v8is a lightweight tag pointing at the same commit asv8.1.1, so@v8resolves there today. Pinned to that commit and labelled with the concrete version.github/codeql-action—refs/tags/v3peels to thev3.37.9commit (Merge pull request #4109 from github/backport-v3.37.9). The v3 line is kept deliberately; chore(deps): bump github/codeql-action from 3 to 4 #5158 proposes the 3→4 bump and that is its call to make, not this PR's.browserstack/github-actions— pinned to the current tip ofmasterrather than tov1.0.4, becausemasteris ahead of the last tag and moving to the tag would be a version rollback of unknown size, not a pin. Preserving today's behaviour is the point; the comment records what the SHA is so the next reader is not left guessing.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 12 insertions / 12 deletions across 4 files.The
Action references resolvejob insupply-chain.ymlre-checks all 23 references against the GitHub API on this PR, which is the authoritative check for this change.Where this leaves the repo
Every action reference in this repository that is not owned by the
actions/org is now pinned to a commit SHA.TokenPermissionsis clean — all 34 workflows declare a top-levelpermissions:block — and norun:block interpolates${{ github.event.* }}.Remaining
PinnedDependencieswork is first-party only, and splits by version line rather than by family: fourteen workflows still onactions/*@v7, plusactions/setup-python@v6inoverhead-bench.yml/windows-enterprise-tls.yml,actions/cache@v6inoss-golden-path.ymlandactions/upload-artifact@v4inoverhead-bench.yml.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