Interview Prep/GitHub Actions/OIDC & Security Hardening

Why pin actions to a full commit SHA, and how do you keep pins updated?

IntermediateConceptOIDC & Security Hardening
Answer

Tags and branches are mutable. In March 2025 attackers rewrote the tags of the popular tj-actions/changed-files action to a malicious commit that dumped runner memory (secrets) into public logs, affecting every repo that used @v45 or @v44. A 40-character SHA cannot be repointed.

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

Keep pins fresh with Dependabot (package-ecosystem: github-actions) or Renovate, which update the SHA and the version comment. Org admins can enforce SHA pinning with the allowed-actions policy.

All GitHub Actions questions Roadmap: GitHub Actions

More on OIDC & Security Hardening