Skip to content

Pin GitHub-owned actions to commit SHAs#39

Merged
mcgroarty merged 1 commit into
mainfrom
harden/sha-pin-actions
Jun 4, 2026
Merged

Pin GitHub-owned actions to commit SHAs#39
mcgroarty merged 1 commit into
mainfrom
harden/sha-pin-actions

Conversation

@mcgroarty
Copy link
Copy Markdown
Contributor

Pins every actions/* reference in our workflows to a full commit SHA, with a trailing # vN comment so Dependabot can still apply version-update rules.

Third-party pnpm/action-setup was 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 of deploy.yml, inherit pages: write and id-token: write. Full SHAs make the reference immutable.

Changes

  • .github/workflows/ci.yml: pin actions/checkout, actions/setup-node, actions/cache, actions/upload-artifact.
  • .github/workflows/deploy.yml: pin actions/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.

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.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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@v6 and actions/setup-node@v6 with full commit SHAs in CI and deploy workflows.
  • Replaced actions/cache@v5 with 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.

@mcgroarty mcgroarty merged commit a7a59a1 into main Jun 4, 2026
5 checks passed
@mcgroarty mcgroarty deleted the harden/sha-pin-actions branch June 4, 2026 01:25
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