Skip to content

chore: pin GitHub Actions to commit SHAs#38

Merged
eloi010 merged 5 commits into
mainfrom
chore/pin-github-actions-20260511
Jun 25, 2026
Merged

chore: pin GitHub Actions to commit SHAs#38
eloi010 merged 5 commits into
mainfrom
chore/pin-github-actions-20260511

Conversation

@BGos87

@BGos87 BGos87 commented May 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Pin every uses: ref in .github/workflows/ (and any composite action
files) to a full 40-character commit SHA, with the original tag
preserved as a # vX comment.

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 -u PR.

Test plan

  • CI green on this branch

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 in prpush.yml and security-code-scanner.yml to immutable 40-character commit SHAs, with the original tag kept as a # vX comment—no functional version bumps, aligned with org supply-chain policy.

Hardens workflow permissions: both workflows set top-level permissions: {}, and CI jobs grant only contents: read where needed. The test job no longer requests pull-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.0 SHA) instead of the mutable @v2 tag.

Reviewed by Cursor Bugbot for commit 7ccb5d0. Bugbot is set up for automated code reviews on this repo. Configure here.

BGos87 and others added 2 commits May 11, 2026 15:50
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).
@github-advanced-security

Copy link
Copy Markdown

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:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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. Since v4 currently 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.

Comment thread .github/workflows/prpush.yml
Comment thread .github/workflows/prpush.yml
Comment thread .github/workflows/prpush.yml
Comment thread .github/workflows/prpush.yml
Comment thread .github/workflows/prpush.yml
Comment thread .github/workflows/security-code-scanner.yml
@Tabaie

Tabaie commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

The principle is sound, but I don't know which builds are approved by our security team.

@eloi010 eloi010 merged commit 17e04ae into main Jun 25, 2026
14 checks passed
@eloi010 eloi010 deleted the chore/pin-github-actions-20260511 branch June 25, 2026 07:48
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.

5 participants