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.
More on OIDC & Security Hardening
How does GitHub OIDC work, end to end?IntermediateWhat are the `sub` claim formats, and which do you put in an AWS trust policy?AdvancedConfigure OIDC to AWS: provider, role and workflow.AdvancedConfigure OIDC to Azure.AdvancedConfigure OIDC to GCP.AdvancedWhat is script injection, and how do you fix it?Advanced