Pin first-party Actions to SHAs#3945
Merged
Merged
Conversation
This is intended as a workaround until #3556 is merged.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR strengthens workflow reproducibility/supply-chain posture by pinning first-party GitHub Actions (from the actions org) to immutable commit SHAs instead of floating release tags, while retaining the human-readable tag in trailing comments for maintainability.
Changes:
- Add a
pinnedUses()helper to generateuses:scalars pinned to SHAs with an inline# vX.Y.Zcomment. - Extend the
pr-checks/sync-back.tssync-back logic (and tests) to update both inlineuses: "owner/action@ref"strings andpinnedUses(...)calls. - Update templates and workflows to use SHA-pinned
actions/*references with version comments.
Show a summary per file
| File | Description |
|---|---|
| pr-checks/sync.ts | Introduces pinnedUses() and uses it for setup actions + checkout when generating workflows. |
| pr-checks/sync-back.ts | Updates sync-back to replace both inline uses: "..." and pinnedUses(...) references (ref + version comment). |
| pr-checks/sync-back.test.ts | Adds coverage ensuring pinnedUses(...) refs are updated correctly (SHA and version string). |
| pr-checks/checks/with-checkout-path.yml | Pins actions/checkout to a SHA with # v6.0.3 comment. |
| pr-checks/checks/submit-sarif-failure.yml | Pins actions/checkout to a SHA with # v6.0.3 comment. |
| pr-checks/checks/multi-language-autodetect.yml | Pins actions/setup-python to a SHA with # v6.2.0 comment. |
| pr-checks/checks/job-run-uuid-sarif.yml | Pins actions/upload-artifact to a SHA with # v7.0.1 comment. |
| pr-checks/checks/go-indirect-tracing-workaround-no-file-program.yml | Pins actions/github-script to a SHA with # v8.0.0 comment. |
| pr-checks/checks/go-indirect-tracing-workaround-diagnostic.yml | Pins actions/setup-go and actions/github-script to SHAs with version comments. |
| pr-checks/checks/export-file-baseline-information.yml | Pins actions/upload-artifact to a SHA with # v7.0.1 comment. |
| pr-checks/checks/diagnostics-export.yml | Pins actions/upload-artifact and actions/github-script to SHAs with version comments. |
| pr-checks/checks/config-export.yml | Pins actions/upload-artifact and actions/github-script to SHAs with version comments. |
| pr-checks/checks/bundle-zstd.yml | Pins actions/github-script and actions/upload-artifact to SHAs with version comments. |
| pr-checks/checks/bundle-toolcache.yml | Pins actions/github-script to a SHA with # v8.0.0 comment. |
| pr-checks/checks/bundle-from-toolcache.yml | Pins actions/github-script to a SHA with # v8.0.0 comment. |
| pr-checks/checks/analysis-kinds.yml | Pins actions/upload-artifact and actions/github-script to SHAs with version comments. |
| .github/workflows/update-supported-enterprise-server-versions.yml | Pins actions/setup-python and actions/checkout to SHAs with version comments. |
| .github/workflows/update-release-branch.yml | Pins actions/checkout and actions/create-github-app-token to SHAs with version comments. |
| .github/workflows/update-bundle.yml | Pins actions/checkout, actions/setup-python, and actions/setup-node to SHAs with version comments. |
| .github/workflows/test-codeql-bundle-all.yml | Pins actions/checkout and actions/setup-dotnet to SHAs with version comments. |
| .github/workflows/rollback-release.yml | Pins actions/checkout and actions/create-github-app-token to SHAs with version comments. |
| .github/workflows/rebuild.yml | Pins actions/checkout and actions/setup-node to SHAs with version comments. |
| .github/workflows/query-filters.yml | Pins actions/checkout and actions/setup-node to SHAs with version comments. |
| .github/workflows/python312-windows.yml | Pins actions/setup-python and actions/checkout to SHAs with version comments. |
| .github/workflows/publish-immutable-action.yml | Pins actions/checkout and actions/publish-immutable-action to SHAs with version comments. |
| .github/workflows/prepare-release.yml | Pins actions/checkout to a SHA with # v6.0.3 comment. |
| .github/workflows/pr-checks.yml | Pins actions/checkout, actions/setup-node, actions/upload-artifact, and actions/download-artifact to SHAs with version comments. |
| .github/workflows/post-release-mergeback.yml | Pins actions/checkout, actions/setup-node, actions/setup-python, and actions/create-github-app-token to SHAs with version comments. |
| .github/workflows/debug-artifacts-safe.yml | Pins actions/checkout, actions/setup-go, actions/setup-dotnet, and actions/download-artifact to SHAs with version comments. |
| .github/workflows/debug-artifacts-failure-safe.yml | Pins actions/checkout, actions/setup-go, actions/setup-dotnet, and actions/download-artifact to SHAs with version comments. |
| .github/workflows/codescanning-config-cli.yml | Pins actions/checkout and actions/setup-node to SHAs with version comments. |
| .github/workflows/codeql.yml | Pins actions/checkout to a SHA with # v6.0.3 comment. |
| .github/workflows/check-expected-release-files.yml | Pins actions/checkout to a SHA with # v6.0.3 comment. |
| .github/workflows/__with-checkout-path.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__upload-sarif.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__upload-ref-sha-input.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__unset-environment.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__swift-custom-build.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__swift-autobuild.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__submit-sarif-failure.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__start-proxy.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__split-workflow.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__rust.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__ruby.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__rubocop-multi-language.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__resolve-environment-action.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__remote-config.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__packaging-inputs-js.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__packaging-config-js.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__packaging-config-inputs-js.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__packaging-codescanning-config-inputs-js.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__overlay-init-fallback.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__multi-language-autodetect.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__local-bundle.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__language-aliases.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__job-run-uuid-sarif.yml | Generated workflow; updated actions/upload-artifact to a SHA pin with version comment. |
| .github/workflows/__javascript-source-root.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__init-with-registries.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__go-tracing-legacy-workflow.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__go-tracing-custom-build-steps.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__go-tracing-autobuilder.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__go-indirect-tracing-workaround.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__go-indirect-tracing-workaround-no-file-program.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__go-indirect-tracing-workaround-diagnostic.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__go-custom-queries.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__global-proxy.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__extractor-ram-threads.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__export-file-baseline-information.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__diagnostics-export.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__cpp-deptrace-enabled.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__cpp-deptrace-enabled-on-macos.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__cpp-deptrace-disabled.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__config-input.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__config-export.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__cleanup-db-cluster-dir.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__bundle-zstd.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__bundle-toolcache.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__bundle-from-toolcache.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__bundle-from-nightly.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__build-mode-rollback.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__build-mode-none.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__build-mode-manual.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__build-mode-autobuild.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__autobuild-working-dir.yml | Generated workflow; updated actions/checkout to a SHA pin with version comment. |
| .github/workflows/__autobuild-direct-tracing-with-working-dir.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__autobuild-action.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__analyze-ref-input.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__analysis-kinds.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/workflows/__all-platform-bundle.yml | Generated workflow; updated actions/* references to SHA pins with version comments. |
| .github/actions/release-initialise/action.yml | Pins actions/setup-node and actions/setup-python to SHAs with version comments. |
Copilot's findings
- Files reviewed: 34/90 changed files
- Comments generated: 0
mario-campos
approved these changes
Jun 3, 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.
Pin first-party Actions from the
actionsorg to commit SHAs, rather than using release tags.Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Workflow types:
n/a
Products:
n/a
Environments:
How did/will you validate this change?
.test.tsfiles).pr-checks).If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Monitor CI.
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist