CI: Pin third-party GitHub Actions to commit SHAs#5972
Open
rogerbarreto wants to merge 1 commit into
Open
Conversation
Replaces every floating tag in our workflow and composite action files with an immutable 40-character commit SHA, keeping the original `# vX` comment so Dependabot can still propose version bumps. 186 occurrences across 25 workflows and 2 composite actions. Also widens the github-actions Dependabot entry to use the plural `directories` key with `/.github/actions/*` so composite actions under `.github/actions/<name>/action.yml` are kept up to date. Previously Dependabot only scanned `.github/workflows` and the repo-root `action.yml`, leaving our `python-setup` and `sample-validation-setup` composite actions unmaintained.
Contributor
There was a problem hiding this comment.
Pull request overview
Hardens CI supply-chain security by pinning all third-party GitHub Actions references to immutable commit SHAs (while retaining the original tag in a trailing comment for update visibility), and expands Dependabot scanning so composite actions under .github/actions/* are included.
Changes:
- Pin third-party action
uses:references to 40-char commit SHAs across workflows and composite actions. - Widen Dependabot’s
github-actionsscan scope to include.github/actions/*composite actions.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/stale-issue-pr-ping.yml | Pin actions/checkout and actions/setup-python to SHAs. |
| .github/workflows/python-tests.yml | Pin actions/checkout and pmeier/pytest-results-action to SHAs. |
| .github/workflows/python-test-coverage.yml | Pin actions/checkout and actions/upload-artifact to SHAs. |
| .github/workflows/python-test-coverage-report.yml | Pin actions/checkout, actions/download-artifact, and coverage comment action to SHAs. |
| .github/workflows/python-sample-validation.yml | Pin actions/checkout, artifact upload/download, and cache actions to SHAs. |
| .github/workflows/python-release.yml | Pin actions/checkout and softprops/action-gh-release to SHAs. |
| .github/workflows/python-merge-tests.yml | Pin actions/checkout, dorny/paths-filter, azure/login, artifact/cache, and reporting actions to SHAs. |
| .github/workflows/python-lab-tests.yml | Pin actions/checkout, dorny/paths-filter, and test reporting action to SHAs. |
| .github/workflows/python-integration-tests.yml | Pin actions/checkout, azure/login, artifact/cache, and actions/github-script to SHAs. |
| .github/workflows/python-docs.yml | Pin actions/checkout and astral-sh/setup-uv to SHAs. |
| .github/workflows/python-dev-dependency-upgrade.yml | Pin actions/checkout to a SHA. |
| .github/workflows/python-dependency-range-validation.yml | Pin actions/checkout, artifact upload, and actions/github-script to SHAs. |
| .github/workflows/python-code-quality.yml | Pin actions/checkout, actions/cache, and j178/prek-action to SHAs. |
| .github/workflows/merge-gatekeeper.yml | Pin actions/github-script to a SHA. |
| .github/workflows/markdown-link-check.yml | Pin actions/checkout and umbrelladocs/action-linkspector to SHAs. |
| .github/workflows/label-title-prefix.yml | Pin actions/github-script to a SHA. |
| .github/workflows/label-pr.yml | Pin actions/labeler to a SHA. |
| .github/workflows/label-issues.yml | Pin actions/github-script to a SHA. |
| .github/workflows/issue-triage.yml | Pin actions/checkout, actions/github-script, actions/setup-python, astral-sh/setup-uv, and azure/login to SHAs. |
| .github/workflows/dotnet-verify-samples.yml | Pin actions/checkout, actions/setup-dotnet, azure/login, and artifact upload to SHAs. |
| .github/workflows/dotnet-integration-tests.yml | Pin actions/checkout, actions/setup-dotnet, and azure/login to SHAs. |
| .github/workflows/dotnet-format.yml | Pin actions/checkout and jitterbit/get-changed-files to SHAs. |
| .github/workflows/dotnet-build-and-test.yml | Pin actions/checkout, actions/setup-dotnet, azure/login, reporting, artifact/cache, and actions/github-script actions to SHAs. |
| .github/workflows/devflow-pr-review.yml | Pin actions/github-script, actions/checkout, actions/setup-python, and astral-sh/setup-uv to SHAs. |
| .github/workflows/codeql-analysis.yml | Pin actions/checkout and github/codeql-action/* to SHAs. |
| .github/dependabot.yml | Expand github-actions updates to scan both workflows and composite actions via directories. |
| .github/actions/sample-validation-setup/action.yml | Pin actions/setup-node and azure/login to SHAs. |
| .github/actions/python-setup/action.yml | Pin astral-sh/setup-uv to a SHA. |
westey-m
approved these changes
May 20, 2026
peibekwe
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pins every third-party GitHub Action referenced in our workflows and composite actions to an immutable 40-character commit SHA, with a
# vXcomment so Dependabot can still raise version-bump PRs.Why pin to SHA: a floating tag like
actions/checkout@v6resolves whatever commit the tag points to at run time. If an action repo is compromised, or a maintainer force-pushes a tag, our workflows execute the new code. A SHA pin freezes the bits and is one of the StepSecurity / OpenSSF Scorecard hardening recommendations.Changes
1. SHA pins (186 occurrences across 27 files)
Every
uses: <owner>/<repo>@<tag>rewritten as:Files touched:
.github/workflows/.github/actions/(python-setup,sample-validation-setup)The remaining 2 composite actions (
setup-local-mcp-server,azure-functions-integration-setup) have no third-partyuses:so they were not modified.2. Dependabot scope widened
.github/dependabot.ymlpreviously useddirectory: "/"for the github-actions ecosystem. Per the Dependabot docs and dependabot-core source, that only scans.github/workflows/*.{yml,yaml}plus a repo-rootaction.yml. Composite actions under.github/actions/*/action.ymlwere silently uncovered.Switched to the plural
directorieskey with a glob (the singulardirectorykey does not support globs):Now both
python-setupandsample-validation-setupare in scope, and any future composite action added under.github/actions/<name>/is picked up automatically.Verification
python -c "import yaml; yaml.safe_load(...)"parses all 30 modified yaml files cleanly.uses:line now ends in a[0-9a-f]{40}SHA followed by# vX. Verified with a regex sweep../references (reusable workflows, internal composite actions) left untouched, as intended.Follow-ups (out of scope)
groups:for the github-actions ecosystem to batch all Dependabot action bumps into one weekly PR instead of one per action.labels:while nuget / pip / uv do. Could add["ci", "dependencies"]for filter consistency.Happy to address either in a follow-up if requested.