Skip to content

InsightsSecurity

GitHub Actions workflow lockfiles are in public preview

On 14 October 2026 GitHub released lockfiles that pin every action a workflow uses, including transitive dependencies, to an exact commit. What they change, how to onboard a repository and what breaks along the way.

Published October 16, 20267 min read

On 14 October 2026 GitHub put workflow dependency lockfiles for GitHub Actions into public preview. A lockfile records the exact commit behind every action a workflow uses, and the runner executes that commit, whatever the tag or branch in the workflow file points to at run time. A Require lockfile policy, also in preview, lets administrators block workflows that are not covered by one.

This closes a gap that has been in GitHub Actions since the start. Writing uses: some-org/deploy-action@v3 means "whatever v3 points to when the job starts". Tags and branches can be moved, so the code that runs is not necessarily the code someone reviewed. If an action's repository is compromised, an attacker can repoint a tag and every workflow using it runs the new code, with no change in your repository.

What was available before

The usual defence has been to pin third-party actions to a full commit SHA in the workflow file. It works, but it has three weaknesses:

  • It only covers the first level. A composite action you pinned can itself call other actions by tag. Those transitive references still float.
  • It makes workflows harder to read. A 40-character SHA with a version comment beside it is easy to get wrong and tedious to review.
  • It does not record identity. If a repository is deleted and a new one is created under the same name, a reference by name now points somewhere else.

Lockfiles address all three. The concept documentation states that with a lockfile, SHA pinning in workflow files is no longer necessary.

How it works

The lockfile lives at .github/workflows/actions.lock. It is generated by a GitHub CLI extension, gh actions-lock, and should never be edited by hand. It has two sections:

SectionContents
workflowsEach onboarded workflow file and the action references it uses, such as octo-org/deploy-action@v3.1.0
dependenciesFor each reference: the ref the workflow uses, the commit it resolved to, and the numeric owner_id and repo_id of the source repository

At run time, GitHub Actions runs the locked commit and checks that the repository behind the name still has the recorded owner and repository IDs. Every locked pin, transitive ones included, is checked when the job starts, and a failed check blocks the run. The locked commit must also exist on a branch of the source repository.

Two details on scope:

  • Transitive dependencies are locked for actions, not for reusable workflows. A reusable workflow called from another repository is covered by the lockfile in the repository that defines it. If your organization maintains shared workflows, onboard that repository first.
  • Once a workflow is onboarded, every action it uses must be in the lockfile. You can onboard workflows one at a time, which makes a gradual rollout possible.

Onboarding a repository

The extension needs the GitHub CLI. From the repository root:

terminal
gh extension install github/gh-actions-lock
 
# Lock every workflow under .github/workflows/
gh actions-lock
 
# Or onboard a single workflow first
gh actions-lock .github/workflows/ci.yml

GitHub's how-to recommends enabling Dependabot version updates for GitHub Actions before generating the lockfile, and checking that each uses reference points to a supported, current version of the action.

Review the whole diff, not just the new file. The tool also edits workflows:

  • Version references are made exact. @v3 may become @v3.1.0, the version it resolved. The commit does not change.
  • Local actions are rewritten. uses: ./… references become uses: $/… in workflows and in in-repository action.yml files. The $/ prefix always resolves to the commit being run, so it needs no lockfile entry. Pass --no-migrate-local-actions to skip this rewrite.

If a run hits an error it cannot fix, it changes neither workflows nor the lockfile, so a failed onboarding leaves the repository as it was.

Keeping it current

A lockfile that falls behind blocks work, so maintenance matters as much as the first run.

  • Rerun gh actions-lock whenever a workflow adds, removes or changes a uses dependency, including when a new workflow is added.
  • Dependabot keeps entries in sync. When it opens a version update for an action in an onboarded workflow, it regenerates the matching lockfile entry in the same pull request, with no extra configuration. It does not onboard new workflows; for a workflow without entries it only reports that onboarding is required. If you update actions with another tool, such as Renovate, check that it maintains actions.lock before you depend on it.
  • Floating references do not move on their own. A lock on main or v3 stays on the recorded commit when upstream moves. When the move is legitimate, run gh actions-lock --relock. If the locked commit is no longer reachable upstream, for example after a force-push, --relock still fails and you need --relock --accept-moved to accept the new commit.

The last case is worth treating as an investigation, not a chore. A tag that now points to an unrelated commit is exactly the event the lockfile exists to catch.

Verifying in pull requests

gh actions-lock --verify checks the lockfile without writing anything and exits with an error when it is stale. It also confirms that a commit locked under a branch or partial version is still in that ref's history. Run it on pull requests and make it a required check:

.github/workflows/actions-lock.yml
name: actions-lock
 
on:
  pull_request:
 
permissions:
  contents: read
 
jobs:
  verify:
    runs-on: ubuntu-latest
    env:
      GH_TOKEN: ${{ github.token }}
    steps:
      - uses: actions/checkout@v6
      - run: gh extension install github/gh-actions-lock
      - run: gh actions-lock --verify

If workflows use actions from private or internal repositories, the token needs read access to those as well.

For a faster local check, gh actions-lock --verify-local --no-fix works offline without authentication and fits in a pre-commit hook. It only confirms that every reference has an entry, not that the entries are trustworthy, so keep --verify in CI.

The gh-actions-lock repository links to ready-made workflows, including one that regenerates and commits the lockfile on push. That job needs contents: write and rules that allow GitHub Actions to push.

Making reviews count

A lockfile is only a control if someone reads its diffs. The enforcement guide suggests adding .github/workflows/actions.lock to CODEOWNERS and requiring code owner approval through branch protection or a ruleset. When reviewing:

  • A changed commit means different code will run. Treat it like any dependency version bump.
  • A changed owner_id or repo_id should be rare. It means the repository behind the name is not the one originally locked. Investigate before merging.

Locking does not tell you whether an action is safe. It guarantees that what runs is what was reviewed, which only helps if the review happened.

Enforcing it with the Require lockfile policy

The Require lockfile policy blocks runs of targeted workflows that use actions but are not onboarded to the repository's lockfile. GitHub's guidance is to roll it out in stages:

  1. Scope the policy to repositories, and then workflows, that are already onboarded.
  2. Run it in Evaluate mode and review the results under Policy insights. Evaluate mode is only available on GitHub Enterprise.
  3. Switch to Active only once lockfiles are kept current automatically, through Dependabot, a verify check and an update workflow.
  4. Widen the scope until every workflow is covered and new workflows are onboarded as they are created.

Current limitations

  • It is a preview. The extension is pre-1.0, and the lockfile format, flags and behaviour may change without notice. Read the release notes before upgrading it with gh extension upgrade gh-actions-lock.
  • Availability. The preview covers GitHub Enterprise Cloud, Enterprise Cloud with data residency, Team and Free plans. GitHub Enterprise Server is not supported.
  • Local path actions. A workflow whose uses: ./… reference does not resolve to an action file is skipped during onboarding. Paths resolve from the repository root, not the workflow's directory.
  • Pruning. Only a run over the whole workflows directory removes entries for deleted workflows; a run scoped to one file leaves other entries alone.

What to do now

For most platform teams, a reasonable first step is one repository with high-value workflows, such as the one that deploys to production or publishes packages:

  1. Enable Dependabot version updates for GitHub Actions in that repository.
  2. Fix any tag-pinned entries in your allowed-actions list.
  3. Run gh actions-lock, review the full diff and commit it with CODEOWNERS protection on the lockfile.
  4. Add the --verify check as a required status check.
  5. If you maintain shared reusable workflows, onboard their repository next.
  6. Pilot the Require lockfile policy in Evaluate mode where available, and move to Active once the maintenance loop has run for a while without surprises.

Existing SHA pins keep working, so there is no need to remove them in a hurry. The gain from lockfiles is mostly in what SHA pins never covered: the actions your actions call, and proof that a repository name still means the same repository.