Skip to content

ci: lock action dependencies with a workflow lockfile - #813

Merged
kylebarron merged 2 commits into
mainfrom
kyle/actions-lockfile
Nov 11, 2026
Merged

kylebarron merged 2 commits into
mainfrom
kyle/actions-lockfile

Conversation

@kylebarron

Copy link
Copy Markdown
Member

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 the gh actions-lock extension (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.
  • Readable tags. The tool rewrote 9 SHA pins to full release tags (e.g. Swatinem/rust-cache@d1527c8… to @v2.9.3). Each resolves to the same commit as before.
  • Floating tags narrowed. 38 refs like actions/checkout@v7 became the highest matching full release tag (@v7.0.1). Full tags rarely move, so the locked commit stays valid longer.
  • dtolnay/rust-toolchain@stable to @master with toolchain: stable (separate commit). dtolnay force-pushes the 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; the installed toolchain is unchanged. The existing SHA pin of stable was already unreachable upstream, which is what made the lockfile tool fail.
  • New Actions lockfile workflow that runs gh actions-lock --verify, so CI fails if a uses: has no lockfile entry or a pin no longer verifies upstream. Adapted from the extension's own verify-lockfile.yml.

Dependabot already updates github-actions here. 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.lock by hand.

Not covered

  • Required check. Verify actions lockfile isn't a required status check. Add it in branch protection if it should block merges.
  • "Require lockfile" policy. A repository setting that rejects workflows without a lockfile. Not turned on.
  • pypa/gh-action-pypi-publish runs 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). The pypi-publish action itself is locked.
  • ytanikin/pr-conventional-commits builds a Docker image from its own Dockerfile. The action is locked, but its base image isn't pinned by digest upstream.
  • The gh extension install step in the verify workflow is pinned to a tag, not covered by the lockfile.

Verification

gh actions-lock --verify passes locally: "All 8 workflows valid".

🤖 Written by Claude Code

kylebarron and others added 2 commits November 11, 2026 16:36
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>
@ds-release-bot ds-release-bot Bot added the ci label Nov 11, 2026

@kylebarron kylebarron left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

✅

@kylebarron
kylebarron merged commit bfb8035 into main Nov 11, 2026
11 checks passed
@kylebarron
kylebarron deleted the kyle/actions-lockfile branch November 11, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant