Interview Prep/Git & GitHub/Security: secrets, signing, access and supply chain

Why pin third-party GitHub Actions to a commit SHA?

IntermediateProductionSecurity: secrets, signing, access and supply chain
Answer

Tags are mutable, so a compromised maintainer can repoint v4 to malicious code (as in the tj-actions/changed-files incident). A full 40-character SHA is immutable. Use Dependabot or Renovate to bump pinned SHAs, and add a comment with the human version.

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
All Git & GitHub questions Roadmap: Git & GitHub

More on Security: secrets, signing, access and supply chain