Skip to content

Commit f8007b8

Browse files
chore: pin GitHub Actions to commit SHAs (#175)
## Pin GitHub Actions to commit SHAs GitHub Actions referenced by tag (e.g. `actions/checkout@v4`) use a mutable pointer — the tag owner can move it to a different commit at any time, including a malicious one. This is the attack vector used in the tj-actions/changed-files incident (CVE-2025-30066). Pinning to a full 40-character commit SHA makes the reference immutable. The `# tag` comment preserves human readability so reviewers can tell which version is pinned. Important: a SHA can also originate from a forked repository. A malicious actor can fork an action, push a compromised commit to the fork, and the SHA will resolve — but it won't exist in the upstream canonical repo. Each SHA in this PR was verified against the action's canonical repository (not a fork). ### Changes - `actions/checkout@v4` -> `actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1` - Version: v4.3.1 | Latest: v6.0.2 | Release age: 90d - Commit: actions/checkout@34e1148 - `actions/setup-node@v4` -> `actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0` - Version: v4.4.0 | Latest: v6.3.0 | Release age: 37d - Commit: actions/setup-node@49933ea - `actions/create-github-app-token@v1` -> `actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1.12.0` - Version: v1.12.0 | Latest: v3.0.0 | Release age: 27d - Commit: actions/create-github-app-token@d72941d - `peter-evans/repository-dispatch@v3` -> `peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3` - Version: v3 | Latest: v4.0.1 | Release age: 146d - Commit: peter-evans/repository-dispatch@ff45666 - `andresz1/size-limit-action@v1` -> `andresz1/size-limit-action@e7493a72a44b113341c0cf6186ab49c17c4b65c1 # v1.6.1` - Version: v1.6.1 | Latest: v1.8.0 | Release age: 733d - Commit: andresz1/size-limit-action@e7493a7 - `peter-evans/create-pull-request@v7` -> `peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7.0.11` - Version: v7.0.11 | Latest: v8.1.0 | Release age: 78d - Commit: peter-evans/create-pull-request@22a9089 ### Files modified - `.github/workflows/publish.yml` - `.github/workflows/size.yml` - `.github/workflows/tests.yml` - `.github/workflows/update-moc.yml`
1 parent 4a82530 commit f8007b8

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

.github/workflows/publish.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
version_changed: ${{ steps.check.outputs.changed }}
1919
version: ${{ steps.check.outputs.version }}
2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
2222
with:
2323
fetch-depth: 0
2424

@@ -38,10 +38,10 @@ jobs:
3838
runs-on: ubuntu-latest
3939
environment: npm
4040
steps:
41-
- uses: actions/checkout@v4
41+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
4242

4343
- name: Setup Node.js
44-
uses: actions/setup-node@v4
44+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4545
with:
4646
node-version: '24'
4747
cache: 'npm'
@@ -61,7 +61,7 @@ jobs:
6161
steps:
6262
- name: Generate GitHub App token
6363
id: dispatch-token
64-
uses: actions/create-github-app-token@v1
64+
uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1.12.0
6565
with:
6666
app-id: ${{ vars.GENERIC_CI_RW_APP_ID }}
6767
private-key: ${{ secrets.GENERIC_CI_RW_APP_PRIVATE_KEY }}
@@ -70,7 +70,7 @@ jobs:
7070
vscode-motoko
7171
7272
- name: Trigger vscode-motoko (bump motoko npm in extension)
73-
uses: peter-evans/repository-dispatch@v3
73+
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3
7474
with:
7575
token: ${{ steps.dispatch-token.outputs.token }}
7676
repository: caffeinelabs/vscode-motoko

.github/workflows/size.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ jobs:
66
env:
77
CI_JOB_NUMBER: 1
88
steps:
9-
- uses: actions/checkout@v4
9+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
1010
- run: npm ci
11-
- uses: andresz1/size-limit-action@v1
11+
- uses: andresz1/size-limit-action@e7493a72a44b113341c0cf6186ab49c17c4b65c1 # v1.6.1
1212
with:
1313
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2121

2222
steps:
23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
2424
- name: Use Node.js ${{ matrix.node-version }}
25-
uses: actions/setup-node@v4
25+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2626
with:
2727
node-version: ${{ matrix.node-version }}
2828
cache: 'npm'

.github/workflows/update-moc.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ jobs:
3232
update-moc:
3333
runs-on: ubuntu-latest
3434
steps:
35-
- uses: actions/checkout@v4
35+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
3636

3737
- name: Setup Node.js
38-
uses: actions/setup-node@v4
38+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3939
with:
4040
node-version: '24'
4141
cache: 'npm'
@@ -94,13 +94,13 @@ jobs:
9494

9595
- name: Generate GitHub App token
9696
id: app-token
97-
uses: actions/create-github-app-token@v1
97+
uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1.12.0
9898
with:
9999
app-id: ${{ vars.GENERIC_CI_RW_APP_ID }}
100100
private-key: ${{ secrets.GENERIC_CI_RW_APP_PRIVATE_KEY }}
101101

102102
- name: Create Pull Request
103-
uses: peter-evans/create-pull-request@v7
103+
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7.0.11
104104
with:
105105
token: ${{ steps.app-token.outputs.token }}
106106
branch: auto/moc-${{ steps.versions.outputs.moc_version }}

0 commit comments

Comments
 (0)