Skip to content

CI: Hash-pin all actions #146488

Description

@woodruffw

(Sorry for using a blank issue for this! None of the other templates seemed exactly right.)

I'm proposing that CPython's CI switch to fully-hash-pinned GitHub Actions references. This is enforced by default via zizmor, but currently CPython's configuration relaxes that default here:

"*": ref-pin

Doing so should be a non-breaking change: the versions resolved will be the same as before, and tools like Dependabot/Renovate/pinact will continue to be able to update any action references, including their hashes.

Ref: https://docs.zizmor.sh/audits/#unpinned-uses

CC @sethmlarson

Linked PRs

Activity

  1. added a commit that references this issue on Apr 1, 2026
  2. added 2 commits that reference this issue on Apr 1, 2026
  3. added 5 commits that reference this issue on Apr 1, 2026
  4. added 2 commits that reference this issue on Apr 2, 2026
  5. added a commit that references this issue on Apr 2, 2026
  6. woodruffw commented on Apr 2, 2026

    @woodruffw
    ContributorAuthor

    This is fully done and backported. Thanks a ton @sethmlarson and @hugovk!

  7. hugovk commented on Apr 8, 2026

    @hugovk
    Member

    I've just enabled this setting at https://github.com/python/cpython/settings/actions:

    • Require actions to be pinned to a full-length commit SHA
  8. woodruffw commented on Apr 8, 2026

    @woodruffw
    ContributorAuthor

    I've just enabled this setting at python/cpython/settings/actions:

    FYI that might cause breakage, since GitHub enforces that transitively. So if any of CPython's action dependencies have transitive dependencies that are themselves unpinned, you'll see a pretty opaque job startup failure error.

    (OTOH you might get lucky! The actions ecosystem is doing a way better job with pinning now than it was a few months ago.)

  9. hugovk commented on Apr 8, 2026

    @hugovk
    Member

    Thanks for the warning! I've disabled it then, can try it another time when it's not so late here, and will share/warn more widely.

    I've turned it on in my branch and see how that gets on.

    And we have Zizmor anyway in the newer branches :)

  10. added 2 commits that reference this issue on Apr 16, 2026
  11. hugovk commented on Apr 17, 2026

    @hugovk
    Member

    I've turned it on in my branch and see how that gets on.

    We found one that breaks in hugovk#81:

    Download action repository 'readthedocs/actions@b8bba1484329bda1a3abe986df7ebc80a8950333' (SHA:b8bba1484329bda1a3abe986df7ebc80a8950333)
    Getting action download info
    Error: The actions actions/checkout@v3 and actions/github-script@v6 are not allowed in hugovk/cpython because all actions must be pinned to a full-length commit SHA.
    

    https://github.com/hugovk/cpython/actions/runs/24580183435/job/71875718404?pr=81

    But https://github.com/readthedocs/actions is deprecated and we're planning on getting rid of it: python/core-workflow#587.

  12. added 2 commits that reference this issue on Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    infraCI, GitHub Actions, buildbots, Dependabot, etc.type-securityA security issue

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions