Pin GitHub-owned actions to commit SHAs#39
Merged
Conversation
Replaces tag references (e.g. actions/checkout@v6) with full commit SHAs and a trailing version comment so Dependabot can still apply version-update rules. Enables repo-level sha_pinning_required to be turned on once merged.
There was a problem hiding this comment.
Pull request overview
Pins GitHub-owned GitHub Actions in this repo’s CI and Pages deployment workflows to immutable commit SHAs (while preserving # vN comments for Dependabot), reducing supply-chain risk from mutable tags—especially important for deploy.yml where the workflow has elevated pages and id-token permissions.
Changes:
- Replaced
actions/checkout@v6andactions/setup-node@v6with full commit SHAs in CI and deploy workflows. - Replaced
actions/cache@v5with a full commit SHA in both workflows. - Pinned artifact-related actions (
actions/upload-artifact,actions/configure-pages,actions/upload-pages-artifact,actions/deploy-pages) to full commit SHAs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/ci.yml | Pins GitHub-owned actions (checkout, setup-node, cache, upload-artifact) to full SHAs with # vN comments. |
| .github/workflows/deploy.yml | Pins GitHub-owned actions used for build + GitHub Pages deployment to full SHAs with # vN comments. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pins every
actions/*reference in our workflows to a full commit SHA, with a trailing# vNcomment so Dependabot can still apply version-update rules.Third-party
pnpm/action-setupwas already SHA-pinned in a previous change; this finishes the job for the GitHub-owned actions.Why
Tag references (
@v6) are mutable. A compromised or retagged release would run inside our CI and, in the case ofdeploy.yml, inheritpages: writeandid-token: write. Full SHAs make the reference immutable.Changes
.github/workflows/ci.yml: pinactions/checkout,actions/setup-node,actions/cache,actions/upload-artifact..github/workflows/deploy.yml: pinactions/checkout,actions/setup-node,actions/cache,actions/configure-pages,actions/upload-pages-artifact,actions/deploy-pages.Follow-up (after merge)
Enable repo-level enforcement so future PRs cannot regress:
```bash
gh api -X PUT repos/secondlife/create/actions/permissions \
-F sha_pinning_required=true -f allowed_actions=selected
```
Part of the post-handoff hardening pass on this repo.