Why GitHub Actions workflows should pin dependencies by SHA, not tags
Git tags used in GitHub Actions workflows are mutable pointers that repository owners can silently redirect to different code at any time, posing a supply-chain security risk. Pinning an action to a specific commit SHA ensures the exact audited code runs every time, regardless of upstream changes. Developers should resolve each SHA themselves using the GitHub API rather than copying values from third-party sources, to establish genuine verification. Adding a version comment alongside the SHA, such as '# v4', allows tools like Dependabot to continue offering update pull requests, preventing pinned references from quietly going stale. For actions published on rolling branches, SHA pinning still applies, but teams must actively monitor and bump those references when upstream fixes are released.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in