In one line: GitHub Actions workflow lockfiles bring the Cargo.lock / package-lock.json split to CI — your workflow says the tag (the intent), and what actually runs is the SHA recorded in the lockfile (the resolution). What makes this different from hand-pinning SHAs comes down to two things: (1) it pins transitive dependencies (the actions your actions call), and (2) the runner checks, at job start, the repository's numeric IDs and whether the commit is reachable from the recorded ref.

Why now

The problem

uses: owner/repo@v3 fetches whatever commit the v3 tag or branch points to at run time. Git tags can be moved, so nothing guarantees that the code you reviewed is the code that runs. The standard advice has been "pin to a full-length commit SHA and put the version in a comment," but that approach has four structural holes:

  1. It doesn't reach transitive dependencies. A SHA pins only the uses: lines in your own YAML. If that action is a composite action that calls other/action@v1, the tag is resolved again on every run. That's exactly the path the tj-actions attack took.
  2. Impostor commits. On GitHub, a repository and its forks share one "network" of commits, so a commit that exists only in a fork can be referenced as the parent's owner/repo@SHA. It looks exactly like a correct SHA pin (zizmor's impostor-commit audit detects this).
  3. The repository behind a name can change. owner/repo is only a name. A SHA pin has no way to express that a transfer, deletion, or re-creation could leave a different repository behind the same name.
  4. Readability and drift. Forty-character SHAs with comments are hard for people to read, and the comment and the SHA drift apart when one gets updated without the other (zizmor's ref-version-mismatch audit targets this).

What we wanted was what language package managers already take for granted: a split between the manifest (intent) and the lockfile (resolution), plus the executor verifying that resolution.

How it works

The file

# This file is machine-generated by `gh actions-lock`.
version: 'v0.0.3'
workflows:
    '.github/workflows/lint.yml':
        - 'actions/[email protected]'
        - 'j178/[email protected]'
dependencies:
    'actions/[email protected]':
        ref: 'v7.0.1'
        commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1'
        owner_id: 44036562
        repo_id: 197814629

What happens at run time