Why pin GitHub Actions to a commit SHA?
AdvancedConceptCI/CD
Answer
Tags like @v4 can be moved by the action's owner or by an attacker who compromises it. A full SHA is immutable, which protects against supply-chain attacks such as the 2025 tj-actions/changed-files compromise.
More on CI/CD
CI vs continuous delivery vs continuous deployment?BeginnerWhat is an artifact, and why "build once, deploy many"?IntermediateWhat are the DORA metrics?IntermediateBlue/green vs canary vs rolling?IntermediateWhat is GitOps in one sentence?BeginnerJenkins declarative vs scripted pipeline?Intermediate