GitHub Actions workflow lockfiles are in public preview. Here is how to turn them on, check them in CI, and what they do not protect.
A tag can move after you reviewed it. A lockfile makes the runner use the commit you reviewed. Here is the setup, the CI check, the policy, and what a lockfile cannot tell you.
- Status
- Public preview since 14 October 2026. Pre 1.0, and formats and flags may change
- Plans
- Enterprise Cloud, Enterprise Cloud with data residency, Team and Free. Not GitHub Enterprise Server
- Install
- gh extension install github/gh-actions-lock
- Generate
- gh actions-lock, which writes .github/workflows/actions.lock
- Check in CI
- gh actions-lock --verify
- Enforce
- The Require lockfile policy, in public preview for enterprise, organisation and repository admins
- Known gap
- Workflows that use local path actions are skipped for onboarding
The problem it addresses
A workflow that says uses: some/action@v4 trusts a moving target. GitHub's changelog puts it plainly: tags and branches can move after you review a workflow, so a later run might execute different code. If an action is compromised, a moved tag or branch can introduce malicious code into your workflow without any change to your repository.
A lockfile keeps the references in your workflow and makes the runner execute the exact commits you locked. Your workflow file still reads the way you wrote it, and the lockfile decides what actually runs.
Set it up
The extension needs the gh CLI and does not support GitHub Enterprise Server. Install it, run it from the repository, then review and commit what it generates. Per the README, the first run scans every workflow under .github/workflows, pins each resolvable action to a SHA, and writes the lockfile. Workflows are onboarded to the lockfile one at a time.
gh extension install github/gh-actions-lockgh actions-lock- Review the diff: the lockfile at .github/workflows/actions.lock and any changed workflow files. Pins cover actions, their transitive dependencies and reusable workflow dependencies.
- Commit the lockfile and the workflow changes together, in one reviewable pull request.
- Run gh actions-lock again whenever a workflow is created that has uses dependencies, or an existing one adds or removes some.
What it enforces at run time
Once a workflow is onboarded, every dependency must have a lockfile entry, and the runner uses the recorded commit even if a tag or branch has since moved. The README says each locked pin is checked again the way the runner checks it at job start: the repository was not renamed or transferred, the pinned commit still exists, and full version tags such as v4.2.1 still point at it. Redirects and identity mismatches are blocked at runtime.
Locked actions must also have a branch that contains the locked commit, which the README says makes impostor commit style attacks harder.
Check it in CI
A lockfile that nobody verifies drifts. The README gives two checks. gh actions-lock --verify runs the full check without writing anything, and is the one for CI. It also checks that a commit locked under a branch or partial version such as main or v4 is still in that ref's history. gh actions-lock --verify-local runs offline and only checks that every reference has an entry, not that the entries are trustworthy, so the README says to use --verify in CI.
Writes are all or nothing: if a run finds an error it cannot fix, it changes no workflow and no lockfile entry, even for workflows that are otherwise fine.
Updating pins, and the policy
Locked pins are sticky, so a normal run only resolves references the lockfile does not record yet, and pins to branches or partial versions do not advance when upstream moves. gh actions-lock --relock regenerates the lockfile from the current upstream commits. A suspicious pin, whose recorded commit is no longer reachable upstream, is left as an error, and --accept-moved resolves those as well. Treat an unreachable commit as something to investigate before you accept it.
Dependabot helps with the routine updates. When it opens a version update for an action in an onboarded workflow, it also regenerates the matching lockfile entry in the same pull request. Admins can require lockfiles across an enterprise, organisation or repository with the Require lockfile policy, also in public preview.
What a lockfile does not do
GitHub says it directly: locking does not determine whether the dependency itself is safe, so review dependencies before locking them. A lockfile reliably runs whatever you pointed it at, which includes a version that was already compromised when you locked it.
It is also early. The README calls the tool pre 1.0, warns that the lockfile format, command flags and behaviour may change without notice, and lists local path actions as a short term gap. Expect to revisit your setup as it changes, and keep your own pinned SHAs for anything critical in the meantime.
Where to start
Onboard the workflows that hold secrets first: deploys, releases, package publishing and anything that authenticates to a cloud account. A moved tag in one of those is the expensive case, and they are usually a handful of files. Move the rest across once the CI check has run clean for a week.
What to do
- 1Install the extension and run gh actions-lock in a branch of your most sensitive repository.
- 2Review every generated pin before you commit it, because a lockfile locks whatever you point it at.
- 3Add gh actions-lock --verify to CI so a stale or tampered lockfile fails the build.
- 4Onboard deploy, release and publish workflows first, then the rest.
- 5Let Dependabot keep the lockfile current, and decide whether to turn on the Require lockfile policy for the organisation.
- 6Watch the extension's releases, since the format and flags can change before 1.0.
Common questions
What is a GitHub Actions workflow lockfile?
A file at .github/workflows/actions.lock that records the exact commits of the actions and reusable workflows your workflows depend on, including their transitive dependencies. For a workflow onboarded to it, the runner executes the recorded commits even if a tag or branch has moved.
How do I turn on Actions lockfiles?
Install the gh CLI, run gh extension install github/gh-actions-lock, then run gh actions-lock in your repository and commit the generated lockfile and workflow changes. Workflows are onboarded one at a time.
Do Actions lockfiles work on the Free plan?
Yes. GitHub's changelog lists the public preview for GitHub Enterprise Cloud, Enterprise Cloud with data residency, Team and Free plans. GitHub Enterprise Server is not supported.
How do I check a lockfile in CI?
Run gh actions-lock --verify, which checks without writing anything. The offline gh actions-lock --verify-local only confirms every reference has an entry and does not check that the entries are trustworthy.
Is a lockfile the same as pinning actions to a SHA by hand?
Not quite. Pinning by hand covers the references you write. The lockfile also covers transitive dependencies and reusable workflow dependencies, and the runner verifies the entries, including that the repository was not renamed or transferred and that the commit exists.
Does a lockfile make an action safe?
No. GitHub says locking does not determine whether a dependency is safe, so review dependencies before locking them. A lockfile makes sure you run the commit you reviewed, nothing more.
Sources
Read against the primary documentation rather than secondary coverage. Where a figure comes from a provider's own docs, it is quoted as published on 2026-10-19.
Related
More from Signals
Open the tool.
Ten production categories, three minutes, and a ranked list of what to fix first.
Check your own stack