Skip to content

🔒 Pin GitHub Actions to commit SHAs#2215

Merged
paulinebm merged 7 commits intomainfrom
security/pin-actions-to-sha
Apr 8, 2026
Merged

🔒 Pin GitHub Actions to commit SHAs#2215
paulinebm merged 7 commits intomainfrom
security/pin-actions-to-sha

Conversation

@paulinebm
Copy link
Copy Markdown
Contributor

🔒 Pin GitHub Actions to commit SHAs

This PR pins all GitHub Actions to their exact commit SHA instead of mutable tags or branch names.

Why?
Pinning to a SHA prevents supply chain attacks where a tag (e.g. v4) could be moved to point to malicious code.

Changes

Workflow Action Avant Après SHA
build-image.yml actions/checkout v4 v6.0.2 de0fac2e4500…
build-image.yml docker/metadata-action v5 v5 c299e40c6544…
build-image.yml docker/setup-qemu-action v3 v3 c7c53464625b…
build-image.yml docker/setup-buildx-action v3 v3 8d2750c68a42…
build-image.yml docker/login-action v3 v3 c94ce9fb4685…
build-image.yml rlespinasse/github-slug-action v4.5.0 v4.5.0 797d68864753…
build-image.yml docker/build-push-action v5 v5 ca052bb54ab0…
build-image.yml actions/checkout v4 v6.0.2 de0fac2e4500…
build-image.yml docker/metadata-action v5 v5 c299e40c6544…
build-image.yml docker/setup-qemu-action v3 v3 c7c53464625b…
build-image.yml docker/setup-buildx-action v3 v3 8d2750c68a42…
build-image.yml docker/login-action v3 v3 c94ce9fb4685…
build-image.yml rlespinasse/github-slug-action v4.5.0 v4.5.0 797d68864753…
build-image.yml docker/build-push-action v5 v5 ca052bb54ab0…
slugify.yaml actions/setup-go v5 v5 40f1582b2485…
deploy-prod.yml actions/checkout v4 v6.0.2 de0fac2e4500…
deploy-prod.yml docker/login-action v3 v3 c94ce9fb4685…
deploy-prod.yml docker/metadata-action v5 v5 c299e40c6544…
deploy-prod.yml docker/setup-buildx-action v3 v3 8d2750c68a42…
deploy-prod.yml rlespinasse/github-slug-action v4.5.0 v4.5.0 797d68864753…
deploy-prod.yml docker/build-push-action v5 v5 ca052bb54ab0…
deploy-prod.yml rlespinasse/github-slug-action v4.5.0 v4.5.0 797d68864753…
deploy-prod.yml aurelien-baudet/workflow-dispatch v2 v2 93e95b157d79…
build-docs.yml huggingface/doc-builder/.github/workflows/build_main_documentation.yml main main 90b4ee2c10b8…
build-pr-docs.yml huggingface/doc-builder/.github/workflows/build_pr_documentation.yml main main 90b4ee2c10b8…
upload-pr-documentation.yml huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml main main 90b4ee2c10b8…
trufflehog.yml actions/checkout v4 v6.0.2 de0fac2e4500…
trufflehog.yml trufflesecurity/trufflehog main main 6bd2d14f7a4b…

🤖 Generated by /github-actions-audit — [security/pin-actions-to-sha]

Closes huggingface/tracking-issues#79

@paulinebm paulinebm marked this pull request as ready for review April 2, 2026 12:23
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 82b0b153ab

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Pin checkout to v4 SHA instead of upgrading to v6

This change is presented as a SHA pinning hardening update, but it also upgrades actions/checkout from v4 to v6.0.2 in the build workflow that runs on self-hosted aws-general-8-plus runners; that introduces a runtime compatibility change unrelated to pinning and can cause CI failures on runners that are still provisioned for the v4 line. To avoid breaking builds during a security-only update, pin to a v4 commit (or perform the major-version runner upgrade in a separate, explicit change).

Useful? React with 👍 / 👎.

@paulinebm paulinebm merged commit 8428e32 into main Apr 8, 2026
6 of 7 checks passed
@paulinebm paulinebm deleted the security/pin-actions-to-sha branch April 8, 2026 14:29
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