Lock Your GitHub Actions
- ID
- 45865
- Status
- summarized
- Published
- 12 Nov 2026, 6:16 AM
- Fetched
- 12 Nov 2026, 11:30 PM
- Provider
- Hacker News
- Category
- dev-community
- Original URL
- https://hugovk.dev/blog/2026/lock-github-actions/
- Source URL
- https://hnrss.org/best
Summary
- Score
- 7.5
- Created
- 12 Nov 2026, 11:32 PM
- Tags
- Audience
- developersvibe_coders
What happened
Hugo van Kemenade walks through GitHub Actions' new workflow lockfile support: instead of pinning every `uses:` line to a full 40-character SHA, you install the `gh-actions-lock` CLI extension (`gh extension install github/gh-actions-lock`), run `gh actions-lock`, and it rewrites steps to plain tags like `actions/checkout@v7.0.1` while generating `.github/workflows/actions.lock` (format version `v0.0.3`) that records each action's `ref`, `sha1-` commit, `owner_id` and `repo_id`. Renovate and Dependabot already update the lockfile, and GitHub recommends a separate `verify-lockfile.yml` CI job (which the author folded into his lint workflow as a parallel job) to catch stale or corrupt lockfiles. The post got 310 points and 60 comments on Hacker News.
Why it matters
If your workflows currently carry SHA pins with `# v7.0.1` comments, you now have a choice to make: keep hand-maintained SHAs, or move to tags plus a committed `actions.lock`. Moving only helps if you also commit the lockfile and add the verification job — without that CI check, a tampered or drifted tag silently resolves to whatever the lockfile says, or nothing catches a lockfile that was never regenerated after an edit. Also check your Renovate/Dependabot cooldowns, since bot PRs now touch the lockfile too.
Discussion angle
Is swapping readable version tags plus a lockfile actually safer in practice than SHA pinning, given the lockfile is only as good as the CI job that verifies it — and who in the room has AI-generated workflow YAML that nobody has reviewed?