Skip to content

Pin GitHub Actions to full-length commit SHAs - #1012

Open
Johannes Schindelin (dscho) wants to merge 2 commits into
vfs-2.56.0from
github-actions-sha1-pins
Open

Johannes Schindelin (dscho) wants to merge 2 commits into
vfs-2.56.0from
github-actions-sha1-pins

Conversation

@dscho

Copy link
Copy Markdown
Member

This PR pins GitHub Actions to full-length commit SHAs in the hopes to improve security and reproducibility. This work is described in more detail at https://aka.ms/action-pinning.

Pinning actions to commit SHAs prevents supply-chain attacks where a tag could be moved to point to malicious code. This is a recommended security best practice per the GitHub Actions security hardening guide.

This change mitigates the risk of tag retargeting to malicious code as seen in incidents like the tj-actions/changed-files action
compromise
or codfish/semantic-release-action compromise and improves the integrity and reproducibility of the CI/CD pipeline.

Third-party action references in .github/workflows/ that used mutable tag-based references (e.g., actions/checkout@v4) have been updated to full-length commit SHAs with a version comment (e.g., actions/checkout@<sha> # v4) using the pinact tool. References that were already pinned to a SHA, or that used immutable release tags, were left unchanged.

Microsoft Git inherits GitHub workflows from upstreams that use
non-pinned versions for convenience. For compliance reasons, Microsoft
Git must pin those to SHA-1s.

Here is a script that exchanges the moving tags/refs in the `uses:`
statements with their fixed SHA-1s.

Assisted-by: GPT-6.1 Sol
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Microsoft Git inherits workflows that upstream maintains using symbolic
Action refs. Downstream organizational policy requires full commit IDs
instead, adding pin maintenance to this project's maintainers' workload.

Keep pins aligned with the original upstream Action refs in a fresh
downstream snapshot, independent of any earlier pinning commit.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant