Lock your GitHub Actions
GitHub Actions now supports workflow lockfiles[1]. Earlier advice was to pin each action to a full commit SHA[2] instead of a tag, because tags can be moved. An attacker can point a previously safe tag at malicious code in a supply-chain attack[3].
The author installs the gh-actions-lock extension for the gh CLI and runs gh actions-lock in the repository. The command changes action references to vX.Y.Z tags and writes .github/workflows/actions.lock, which records the commit SHA for each tag. Renovate and Dependabot already update the lockfile, and GitHub recommends checking it in CI. The author adds a separate lockfile job that runs gh actions-lock --verify on the lightweight ubuntu-slim runner.
The author also recommends zizmor[4], a security linter for GitHub Actions. Versions before v1.32.0 of zizmor tell users to hash-pin actions, and v1.32.0 is the first to support lockfiles.
Read the original hugovk.devDiscussion
Discussion
Commenters mostly ask what lockfiles add over pinning a commit SHA in the reference, and some mention tools such as actions-up and pinact. The zizmor maintainer lists limits: only normal action calls are locked, composite actions are locked through their callers, and reusable workflows still need manual hash pinning.
Links from the post and discussion
Sources
-
Hugo van Kemenade
Lock Your GitHub Actions
-
KRGeekNews KO
GitHub Actions를 잠금 파일로 고정하기


