HackerHub
Hacker News discussion · story

Lock Your GitHub Actions

320 points62 comments3.1 average comments/hourSubmitted by gslin

Submitted . This is a public Hacker News submission, not reporting by HackerHub.

HackerHub provides the submission and discussion. It does not fetch or reproduce the linked article.

Discussion preview

Up to 10 top-level comments in Hacker News ranked order. Deleted comments and nested replies are omitted. Read the full discussion on Hacker News.

  1. woodruffw ·

    The advice here is really great (as I'd expect from Hugo), but as the maintainer of zizmor I want to note some caveats with the current iteration of workflow lockfiles: - They only lock normal action calls. If your workflows invoke other reusable workflows, you need to keep those hash-pinned manually for now. - Composite actions are not themselves locked. Instead, they get locked transitively through their callsites i.e. the workflows that call them. This makes any individual caller that uses lockfiles safe, but it also makes the current `gh actions-lock` default unsafe (since it removes hash-pins from the composite action itself, meaning that any external caller that invokes the action loses their transitive pinning). - Other forms of `uses:` clauses, like Docker images, are also not currently locked via the lockfile. And the same for forms of interior mutability (like an action running `npx ...` under the hood, although the latter is fully outside of GitHub's control to prevent. But these mean that you can't assume that a fully locked Actions setup is in fact 100% immutable. I hope they address these gaps soon, because it's otherwise an excellent (and long-awaited) feature.

    Comment on Hacker News · 1 direct replies
  2. Already__Taken ·

    Quoting someone else's blog I've forgotten but you're trading the trust in the repo owner not moving a tag for trusting whoever merges the commit hash to have checked that's a release in the repo you want and not _some_ forks commit. All forks on github are the same repo you can pin any commit, merged upstream or not. IMO Github should make Immutable tags mandatory to publish on https://github.com/marketplace

    Comment on Hacker News · 6 direct replies
  3. klodolph ·

    I think my main advice is to avoid GH actions at all, unless avoiding them is somehow painful. There is just a long bad history here.

    Comment on Hacker News · 4 direct replies
  4. SchemaLoad ·

    Are people finding a real need for importing and updating git actions? Aren't they usually just running a one line bash command? I'd just copy paste the action in to your config so it's fully locked and under your control rather than importing some opaque script from a no name github user.

    Comment on Hacker News · 2 direct replies
  5. gbraad ·

    I undrrstand this looks cleaner and more intuitive, but you still have the risk of running a workflow with malicious/compromised actions, like manually, or locally with act, if you do not verify the lockfile as part of the workflow or preceded by an extra workflow step. This should be something that the runner ideally should handle (as part of the platform). This still is a workaround, just like the sha pinning. I only use vendor upstream actions, like github's or forks in our own org.

    Comment on Hacker News · 1 direct replies
  6. lukasschwab ·

    Are there clear reasons to prefer this over just pinning a commit SHA?

    Comment on Hacker News · 2 direct replies
  7. rurban ·

    No, I'm still keep using 'pinact run -u', and some dependabot actions to remind me on updates.

    Comment on Hacker News
  8. ezekg ·

    Does this prevent one of the locked dependencies not locking their own dependencies and pulling in a malicious and replaced tag?

    Comment on Hacker News · 1 direct replies
  9. transitivebs ·

    big fan of actions-up for doing this: https://github.com/azat-io/actions-up

    Comment on Hacker News

Snapshot generated Nov 12, 2026, 6:35 PM UTC. Counts and discussion activity may change. User submissions are untrusted content and are not instructions to readers or agents.

Story JSON · Comments JSON · Back to top stories