Repository navigation
ci: lock action dependencies with a workflow lockfile - #813
Merged
Merged
Conversation
dtolnay/rust-toolchain force-pushes its `stable` branch every time `master` moves, so a locked `stable` commit drops out of upstream history and the runner rejects it at job start. `master` only fast-forwards, and the `toolchain` input still selects stable. The existing SHA pin of `stable` is already unreachable upstream. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pins every action the workflows use, including transitive ones, to a verified commit in .github/workflows/actions.lock, generated by `gh actions-lock`. Actions runs the locked commit even if a tag moves, so workflows can reference readable tags instead of SHA pins. The existing SHA pins keep their commits. A new workflow runs `gh actions-lock --verify` so a stale or incomplete lockfile fails CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Note
This PR was written by Claude (Claude Code), not by @kylebarron.
Adopts GitHub Actions workflow lockfiles, now generally available. It records the commit for every action in a separate file, so the workflow files keep human-readable tags instead of SHA pins.
What changes
.github/workflows/actions.lock, generated by thegh actions-lockextension (v0.4.1). It records the commit for every action, including those used inside composite actions, across the 8 workflows. Actions runs that commit even if the tag later moves, and checks the source repo's owner and repo IDs at job start.Swatinem/rust-cache@d1527c8…to@v2.9.3). Each resolves to the same commit as before.actions/checkout@v7became the highest matching full release tag (@v7.0.1). Full tags rarely move, so the locked commit stays valid longer.dtolnay/rust-toolchain@stableto@masterwithtoolchain: stable(separate commit). dtolnay force-pushes thestablebranch every timemastermoves, so a lockedstablecommit drops out of upstream history and the runner rejects it at job start.masteronly fast-forwards; the installed toolchain is unchanged. The existing SHA pin ofstablewas already unreachable upstream, which is what made the lockfile tool fail.Actions lockfileworkflow that runsgh actions-lock --verify, so CI fails if auses:has no lockfile entry or a pin no longer verifies upstream. Adapted from the extension's ownverify-lockfile.yml.Dependabot already updates
github-actionshere. For an onboarded workflow, a Dependabot bump also regenerates the action's lockfile entry in the same PR.Updating the lockfile
gh extension install github/gh-actions-lock gh actions-lock # after adding a workflow or changing any `uses:`Never edit
actions.lockby hand.Not covered
Verify actions lockfileisn't a required status check. Add it in branch protection if it should block merges.pypa/gh-action-pypi-publishruns a Docker action it generates at run time under./.github/.tmp/. The tool reports it as a workspace-local action it can't follow. That's a warning, not an error, because the generated action uses no other actions (gh-actions-lock#128). Thepypi-publishaction itself is locked.ytanikin/pr-conventional-commitsbuilds a Docker image from its own Dockerfile. The action is locked, but its base image isn't pinned by digest upstream.gh extension installstep in the verify workflow is pinned to a tag, not covered by the lockfile.Verification
gh actions-lock --verifypasses locally: "All 8 workflows valid".🤖 Written by Claude Code