Skip to content

Pin GitHub Actions to commit SHAs - #49049

Merged
paulinebm merged 2 commits into
mainfrom
security/pin-actions-to-sha
Sep 23, 2026
Merged

paulinebm merged 2 commits into
mainfrom
security/pin-actions-to-sha

Conversation

@hf-security-analysis

@hf-security-analysis hf-security-analysis Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

CPU CI GPU run-slow

Workflow hardening

Actions pinned to commit SHAs

A version tag is mutable. Whoever controls an action's repository can move v4
to different code, and every workflow referencing @v4 picks that up on the
next run with nothing to review. That is how tj-actions/changed-files shipped
a credential dumper to thousands of repositories in March 2025.

Pinning to a full commit SHA freezes the code that runs. The version tag stays
on the line as a comment, so the reference is still readable.

This pins, it does not upgrade. Every SHA below is the commit the tag
already resolves to today, so nothing about what your CI executes changes — it
only removes the ability for it to change without your knowing.

Workflow Before After
.github/workflows/pr-ci-post-dashboard-link.yml uses: actions/download-artifact@v4 uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0

Opened by the workflow security bot. It changes what this pull request says it
changes, and nothing else.

A tag is mutable: whoever controls the action's repository can move
`v4` to different code, and the next run picks it up with no diff to
review. Pinning to the commit SHA freezes the code that runs today.
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution 🤗!

CI Security Gate — automatic approval blocked

This PR was not automatically approved for CI because the security gate failed.

Possible reasons:

  • The PR touches 50 or more files — only PRs with fewer than 50 changed files are automatically approved
  • A changed file is outside the allowed directories (src/, tests/, docs/, utils/), has a disallowed extension (only .py, .txt, .md permitted outside tests/ and docs/), or is not .md/.yml inside docs/ — this covers files the PR deletes or renames, not only the ones it edits
  • A new high-severity security issue was detected in the changed Python files (Bandit check)
  • The PR touches a path this repository protects from untrusted PRs, such as the file that decides who reviews it — a maintainer must make that change in a separate PR

See the workflow run for the exact violations.

A maintainer can review and manually approve CI if a finding is a false positive.

@github-actions

Copy link
Copy Markdown
Contributor

CI recap

Dashboard: View test results in Grafana
Latest run: 35861261455:1
Result: success | Jobs: 2 | Tests: 26 | Failures: 0 | Duration: 2m 24s

@paulinebm
paulinebm added this pull request to the merge queue Sep 23, 2026
Merged via the queue into main with commit a008a65 Sep 23, 2026
29 of 30 checks passed
@paulinebm
paulinebm deleted the security/pin-actions-to-sha branch September 23, 2026 14:11
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.

2 participants