Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› GitHub Actions SHA Pinning
Cyber Security

GitHub Actions SHA Pinning

← Back to Glossary
By NHI Mgmt Group Updated October 31, 2026 Domain: Cyber Security

GitHub Actions SHA pinning means referencing an action by its full commit hash instead of a moving tag or branch. This reduces supply chain risk because the referenced code cannot silently change after review. In practice, organisations must also check transitive dependencies inside composite actions and reusable workflows.

What SHA pinning changes in GitHub Actions

Pinning an action to a full commit SHA makes the referenced code immutable from the workflow’s point of view. That matters because tags and branches can move after review, while a SHA points to one exact revision. In practice, this turns review into a decision about a specific code snapshot rather than a mutable name.

This is especially important in repositories that rely on third-party actions, where the action’s maintainer, release process, and tag hygiene all become part of the trust boundary. GitHub Actions security is broader than pinning alone, and the GitHub and GitHub Actions Security Guide places SHA pinning in the wider context of workflow permissions, runner hardening, and action risk management.

Why tags and branches are weaker than SHAs

A tag such as v1 is a convenience label, not a guarantee. If that label is retargeted, the workflow can begin executing different code without any visible change in the repository’s workflow file. Branch references have the same problem, with the added issue that any new commit can alter behavior between runs.

SHA pinning removes that moving target. The trade-off is operational: teams must update the pin deliberately when they want a newer revision, and they need a process for reviewing those updates. That discipline is part of supply chain hygiene, not just YAML formatting, and it is the difference between controlled dependency updates and silent drift.

What makes this a supply chain control

GitHub Actions are executable supply chain components. They can install dependencies, read repository secrets, mint cloud credentials through federation, and publish artifacts or packages. If an attacker compromises an action release or a tag, every workflow that trusts that moving reference can inherit the malicious change.

That is why SHA pinning belongs alongside other provenance controls such as release review, dependency vetting, and build integrity checks. It reduces the chance that a trusted workflow step becomes an attacker-controlled delivery mechanism, especially where downstream steps can access secrets, tokens, or deployment targets.

Pinning also interacts with composite actions and reusable workflows. A pinned top-level action does not automatically make nested components safe if they still call out to moving references or pull in unreviewed transitive code. The risk shifts from one obvious dependency to a chain of dependencies that also deserves review.

What organisations should verify after pinning

SHA pinning is only effective when the rest of the workflow trust model is equally deliberate. Teams should know which actions are internal versus third-party, which ones are pinned, and where reusable workflows or composite actions introduce additional execution paths. A pinned reference that hides unreviewed transitive behaviour still leaves room for compromise.

It also helps to watch for the same control failures seen in real-world GitHub Actions supply chain incidents, where stolen tokens, workflow injection, or poisoned references turned routine automation into secret theft. The TeamPCP Threat Actor Profile Guide and the MITRE ATT&CK T1195 Supply Chain Compromise guide both show how supply chain abuse turns trusted delivery paths into exploitation paths.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

SLSA, NIST SP 800-53 Rev 5, OWASP ASVS and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
SLSASupply-chain Levels for Software ArtifactsGitHub Actions pinning supports artifact and build provenance.
Recommendation — Adopt provenance checks so workflow steps and build outputs are tied to reviewed source revisions.
NIST SP 800-53 Rev 5SA-12 — Supply Chain ProtectionPinned actions reduce supply-chain tampering in outsourced and third-party code paths.
SI-7 — Software, Firmware, and Information IntegritySHA pinning preserves workflow integrity by preventing silent code changes after review.
Recommendation — Apply SA-12 to vet third-party workflow code and require controlled updates to referenced revisions. Use SI-7 to detect and block unauthorized changes to workflow-executed code.
OWASP ASVSV15 — Secure Coding and ArchitectureWorkflow references are part of secure software architecture and dependency trust.
Recommendation — Review external workflow dependencies as part of secure architecture and change control.
CIS Controls v8CIS-15 — Service Provider ManagementThird-party actions are service-provider dependencies that require governance and approval.
Recommendation — Inventory and govern third-party workflow providers before allowing them in production pipelines.

Practitioner Guidance

Why practitioners should care: SHA pinning is most valuable where a workflow consumes outside code and where that code can affect secrets, deployments, or release integrity. The operational question is not whether an action is popular, but whether the workflow can tolerate unexpected upstream change.

Governance implication: Treat action pinning as a reviewable policy decision, not a one-time syntax choice. Teams should know who approves action upgrades, how pins are refreshed, and how workflow owners verify that nested references have not reintroduced moving targets.

Practitioner takeaway: Use SHA pinning as the baseline, then pair it with explicit update review, dependency visibility, and controls that limit the blast radius if a pinned or transitive workflow component is later found to be malicious.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 31, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org