security: pin action to sha#391
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens the Validate GitHub Actions workflow by pinning third-party actions to immutable commit SHAs, reducing supply-chain risk from upstream tag movement.
Changes:
- Pinned
actions/checkout,actions/setup-node,pnpm/action-setup, andactions/cacheto specific SHAs. - Pinned
dorny/paths-filterto a specific SHA.
Comments suppressed due to low confidence (1)
.github/workflows/validate.yml:165
- The base checkout step here implicitly uses the default branch HEAD. In a
pull_request_targetworkflow that later uses secrets and writes PR comments, it’s safer/more deterministic to checkout the PR base commit explicitly viaref: ${{ github.event.pull_request.base.sha }}.
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
path: ./head
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
85f54a8 to
9335752
Compare
bearpong
left a comment
There was a problem hiding this comment.
I think CI is broken as no one is running. Please make sure this is not breaking it
|
CI is failing because
https://github.com/pnpm/action-setup
FixUpgrade - uses: pnpm/action-setup@eae0cfeb286e66ffb5155f1a79b90583a127a68b # v2.4.1
+ uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8v6.0.8 uses I verified the SHA: Heads up: Node.js 24 deadline June 2The other pinned actions in this PR ( v5 releases exist for all of them. Recommend a follow-up commit (or separate PR) bumping:
I'll submit a fix to this PR now. |
…ub.event.pull_request.base.sha to the first checkout step in format, data-consistency, detect-changes, upload-assets, images, coingecko, and pyth. With pull_request_target, a bare actions/checkout gets default branch HEAD, which can drift from the PR's recorded base commit. schema already had this; now all 8 jobs are consistent.
…node24 Add persist-credentials: false to every checkout step — both base and head — across all 8 jobs (15 checkout steps total). Prevents GITHUB_TOKEN from being written into .git/config on pull_request_target. upload-assets head checkout already had it. Upgrade remaining actions to node24 before June 2 deadline: actions/checkout v4.3.1 → v5.0.1 actions/setup-node v4.4.0 → v5.0.0 actions/cache v4.3.0 → v5.0.5 dorny/paths-filter v3.0.3 → v4.0.1
|
Superseded by #392. #392 splits validate.yml into two workflows (validate + post-validate) to isolate secrets from fork code. It includes all the changes from this PR — SHA pinning, node24 upgrades, If we merge this first, #392 will conflict on validate.yml. Since #392 is the superset, merge #392 and close this one. |
|
@qtipbera please let's keep changes atomical and debuggable, I prefer not to merge all those changes at once. |
|
@bearpong Makes sense. Merge order:
This PR is ready for re-review when you are. |
|
ty @qtipbera, CI still seems broken though
|
|
@bearpong looks like CI has now passed ser |

Uh oh!
There was an error while loading. Please reload this page.