Skip to content

Pin all GitHub Actions to SHA-based references#19318

Open
brendandburns wants to merge 1 commit intoAzure:mainfrom
brendandburns:gha_sha
Open

Pin all GitHub Actions to SHA-based references#19318
brendandburns wants to merge 1 commit intoAzure:mainfrom
brendandburns:gha_sha

Conversation

@brendandburns
Copy link
Copy Markdown
Member

@brendandburns brendandburns commented Apr 1, 2026

Summary

Switches all GitHub Actions workflow references from mutable tag-based references (e.g. actions/checkout@v6) to immutable SHA-pinned references (e.g. actions/checkout@de0fac2e... # v6), with the original tag preserved as a trailing comment for readability.

Motivation

Using mutable tags in GitHub Actions workflows is a supply chain security risk. Tags are Git refs that can be force-pushed by repository owners (or attackers who compromise an action's repository), meaning a tag like v6 can be silently repointed to arbitrary code at any time. This enables a class of attack where a compromised or malicious action version is injected into CI/CD pipelines without any visible change to the consuming workflow files.

This is not a theoretical risk. In the LiteLLM security incident, attackers exploited mutable tag references to the aquasecurity/trivy-action GitHub Action. A compromised version of the action was published under the same tag, which caused CI/CD pipelines that referenced it by tag to silently execute malicious code — exfiltrating secrets and environment variables from every repository that used the action.

Pinning to commit SHAs makes workflow references immutable and tamper-proof. Even if an upstream action repository is compromised and tags are repointed, SHA-pinned references will continue to resolve to the originally audited code.

This change follows the security policy recommended by the Kubernetes GitHub Actions Policy and GitHub's own security hardening guidance.

Changes

All 12 workflow files under .github/workflows/ have been updated. Every uses: directive now references a full 40-character commit SHA with the original version tag preserved as a comment. No functional changes — all SHAs resolve to the same code as the previously referenced tags.

Microsoft Reviewers: Open in CodeFlow

Switch all GitHub Actions from mutable tag references to immutable
SHA-pinned references to prevent supply chain attacks via tag hijacking.

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth adding a comment explaining the rationale behind this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants