GitHub Action workflow lockfiles

GitHub recently announced workflow lockfiles that can replace SHA pinning for actions.

Here is what a workflow lockfile might look like:

# .github/workflows/test.yml
- uses: actions/checkout@v7.0.1
# .github/workflows/test.yml.lock
actions/checkout@v7.0.1:
resolved: 3d3c42e5aac5ba805825da76410c181273ba90b1
integrity: sha256:a12b3c4d5e6f...

For Ansible collections this seems like a solid improvement over SHA pinning.

Firstly, generated lockfiles remove the error-prone manual process. You often need to go to the action repo, find the release, and then manually copy the commit SHA.

In some cases I’ve observed AI-assisted pinning that generated hallucinated SHAs that broke workflows, which meant that the CI checks didn’t run on PRs. Eventually the missing checks were noticed but, in the meantime, changes were slipping past those gates.

There’s also improved tooling with gh workflow lock that includes cryptographic integrity verification, human-readable semantic versions, and automated Dependabot updates.

Integrity verification is the main security benefit over SHA pinning. Lockfiles include sha256 checksums that GitHub validates on every workflow run. Workflow execution fails if there are mismatches between the declared version, resolved SHA, and integrity hash.

One downside is that GitHub generates one .yml.lock file per workflow file. There is no repo-wide lockfile option. So any collections with multiple workflows will need to have multiple lockfiles. Dependabot can take care of the maintenance but lots of lockfiles will introduce more “visual clutter” in the repo.

What do others think about GHA workflow lockfiles? Is anyone using them already and have insights or tips they want to share?

1 Like

LLM are very bad a SHA, they guess and they don’t know what the latest versions are, and as you mention they often generate random strings

Personally, when I’ve been creating workflows, the process I’ve been using is:

I know there are various similar apps to actions-up, it’s just one I happened to get setup
When I spoke met with GitHub Actions team earlier in the year, the did recomend zizmor

npx actions-up # Update to latest full sha
zizmor  --fix=all  .github/workflows/

Then manually fix any remaining issues

Workflow lockfiles

I’ve not had the chance to look into these, if there is feedback (like repo or Org level locks), I’m happy to pass that on to my contacts in at GitHub

1 Like