chore: pin GitHub Actions to commit SHAs#38
Conversation
Pin every `uses:` ref in .github/workflows and composite actions to a
full 40-character commit SHA, with the original tag preserved as a
comment, e.g.
uses: actions/checkout@11bd719 # v4
Tags and branches are mutable; commit SHAs are not. Pinning to a SHA
closes a supply-chain vector where a compromised action could replace
what runs in CI without changing the tag we reference.
Generated mechanically with `pinact run`
(https://github.com/suzuki-shunsuke/pinact). No version bumps were
applied (strict pin).
…vilege permissions
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
There was a problem hiding this comment.
Pull request overview
This PR hardens the repository’s GitHub Actions workflows by pinning third-party uses: references to immutable commit SHAs and tightening default workflow permissions to least privilege, reducing supply-chain and token-scope risk in CI.
Changes:
- Add workflow-level
permissions: {}and grant job-level permissions explicitly. - Replace mutable
uses:refs (tags/majors) with full 40-char commit SHAs and annotate with a version comment. - Pin the MetaMask security scanner reusable workflow to a commit SHA.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
.github/workflows/prpush.yml |
Adds least-privilege permissions and pins multiple marketplace actions to commit SHAs (with one incorrect major-version change that should be reverted to a strict pin). |
.github/workflows/security-code-scanner.yml |
Adds least-privilege default permissions and pins the reusable security scanner workflow to an immutable commit SHA. |
Comments suppressed due to low confidence (1)
.github/workflows/prpush.yml:75
- The workflow originally referenced
actions/upload-artifact@v4, but the preserved comment is# v4.6.2. Sincev4currently points at this same commit, preserve the original ref (# v4) to match the PR’s stated policy.
go test -json -v -run=NONE -fuzz=Compress$ -fuzztime=30s ./lzss 2>&1 | gotestfmt
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The principle is sound, but I don't know which builds are approved by our security team. |
Summary
Pin every
uses:ref in.github/workflows/(and any composite actionfiles) to a full 40-character commit SHA, with the original tag
preserved as a
# vXcomment.Why
Tags and branches are mutable, so a compromised action can replace what
runs in our pipelines without changing the tag we reference. Pinning to
a SHA closes that supply-chain vector. See GitHub's hardening guide:
https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-third-party-actions.
Deadline
TechOps is enforcing SHA-pinned GitHub Actions across the org by
June 8, 2026. Merging this PR brings the repo into compliance ahead
of the cut-over; after that date workflows that still reference
mutable tags or branches will be blocked from running.
How
Generated mechanically with
pinact run.No version bumps were applied (strict pin); follow-up upgrades can come
from Renovate or a separate
pinact run -uPR.Test plan
Note
Low Risk
CI workflow-only changes that reduce default permissions and pin action SHAs; no application or runtime behavior changes.
Overview
Pins every third-party
uses:reference inprpush.ymlandsecurity-code-scanner.ymlto immutable 40-character commit SHAs, with the original tag kept as a# vXcomment—no functional version bumps, aligned with org supply-chain policy.Hardens workflow permissions: both workflows set top-level
permissions: {}, and CI jobs grant onlycontents: readwhere needed. The test job no longer requestspull-requests: write(it previously had that permission).The security scanner reusable workflow call is pinned to a specific commit on
MetaMask/action-security-code-scanner(v2.1.0SHA) instead of the mutable@v2tag.Reviewed by Cursor Bugbot for commit 7ccb5d0. Bugbot is set up for automated code reviews on this repo. Configure here.