Skip to content

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

Merged
kylebarron merged 1 commit into
mainfrom
kyle/actions-lockfile
Nov 11, 2026
Merged

kylebarron merged 1 commit 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 5 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 7 SHA pins to full release tags (e.g. ytanikin/pr-conventional-commits@639145d… to @1.5.2). Each resolves to the same commit as before.
  • Floating tags narrowed. 6 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.
  • 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 5 workflows valid".

🤖 Written by Claude Code

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 6185e48 into main Nov 11, 2026
7 checks passed
@kylebarron
kylebarron deleted the kyle/actions-lockfile branch November 11, 2026 21:59
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