Lock Your GitHub Actions hugovk.dev · 279 points · 58 comments · HN thread TL;DR...

@best30

Lock Your GitHub Actions hugovk.dev · 279 points · 58 comments · HN thread

TL;DR Hugo van Kemenade's post walks through GitHub's new workflow lockfiles for Actions: install the gh-actions-lock extension, run gh actions-lock to switch pins from full SHAs to vX.Y.Z tags recorded in .github/workflows/actions.lock, add a CI job that runs gh actions-lock --verify, and use zizmor for linting. The HN thread (279 points, 58 comments) is mostly skeptical of GitHub Actions in general, with the maintainer of zizmor noting several gaps in what lockfiles cover.

  • Full SHA pinning was the previous advice because tags are mutable and can be moved to malicious code in a supply-chain attack.
  • gh actions-lock converts SHA pins to version tags in workflows and writes actions.lock, which records the commit SHA, owner ID and repo ID for each action.
  • Lockfiles also pin transitive dependencies of actions, which is the main new capability per the official GitHub announcement, though the post itself does not state this clearly.
  • The post suggests a separate lockfile verification job in CI, using the ubuntu-slim runner and a pinned version of the extension (v0.4.1).
  • Dependabot and Renovate already update the lockfile, and the author recommends using cooldowns.
  • zizmor v1.32.0 is the first version that supports lockfiles; earlier versions still recommend hash-pinning.

Discussion The thread is largely a debate about whether lockfiles meaningfully improve GitHub Actions security. Several commenters, including the zizmor maintainer, praise the feature as a long-awaited step while listing its gaps: reusable workflows, composite actions, Docker images and runs-on images are not locked, and forks can still supply impostor commits. Many others argue the whole system is poor and suggest alternatives like Jenkins or a cron job, while others push back that self-hosting and cross-platform builds have real costs. The mood is skeptical and sometimes sardonic, with a notable subthread about whether the article itself explained the transitive-pinning point clearly enough.

  • Lockfiles are a real improvement over SHA pinning (many): Commenters note that lockfiles pin transitive dependencies, which SHA pinning did not, and that GitHub is finally tackling a major supply-chain criticism. Several say it brings Actions closer to npm and Cargo-style ecosystems.
  • Lockfiles still leave significant gaps (many): The zizmor maintainer lists unlocked reusable workflows, composite actions, Docker images and interior mutability such as npx calls. Others note that the default gh actions-lock behavior can remove hash pins from composite actions, weakening their safety for external callers.
  • GitHub Actions is fundamentally bad; avoid it (many): A large group argues the platform has a long bad history and recommends self-hosting with Jenkins, a cron job, or a home machine. Pushback points out that Pi or home servers cannot easily build Windows and macOS binaries, and Jenkins has its own security problems.
  • Lockfile is just SHA pinning with extra steps (some): Some commenters see the new scheme as adding a second file to verify without solving the core trust problem. They argue that version tags with a comment on the same line are simpler.
  • Copy or vendor actions instead of importing them (a few): Some prefer copying an action's action.yml into their repo with a comment noting the upstream URL, arguing this keeps everything under local control. Others reply that many actions are too complex to copy.
  • Lockfile should be enforced by the runner (a few): One commenter argues the runner itself should verify lockfiles automatically, since running gh actions-lock --verify inside the workflow is still a workaround that local act runs can skip.

Links from the comments

#GitHubActions #supplyChain #CICD #zizmor #Security