Skip to content

Commit 913f017

Browse files
committed
CI: Pin GitHub Actions to commit SHAs
Pin all third-party actions to immutable commit SHAs, with the resolved version tag in a trailing comment. This prevents upstream tags from silently changing under us. - actions/checkout → v6.0.2 - actions/upload-artifact → v7.0.0 - actions/download-artifact → v4.3.0 `actions/checkout` is bumped from v5 to v6 at the same time. v6 stores the git credentials outside the working tree, so it can no longer be picked up by subsequent `actions/upload-artifact` steps. See https://docs.zizmor.sh/audits/#unpinned-uses and https://docs.zizmor.sh/audits/#artipacked
1 parent 7659cec commit 913f017

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
run_type: ${{ steps.jobs.outputs.run_type }}
5353
steps:
5454
- name: Checkout the source code
55-
uses: actions/checkout@v5
55+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5656
- name: Test citool
5757
# Only test citool on the auto branch, to reduce latency of the calculate matrix job
5858
# on PR/try builds.
@@ -117,7 +117,7 @@ jobs:
117117
run: git config --global core.autocrlf false
118118

119119
- name: checkout the source code
120-
uses: actions/checkout@v5
120+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
121121
with:
122122
fetch-depth: 2
123123

@@ -254,7 +254,7 @@ jobs:
254254
df -h
255255
256256
- name: upload artifacts to github
257-
uses: actions/upload-artifact@v7
257+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
258258
with:
259259
# name is set in previous step
260260
name: ${{ env.DOC_ARTIFACT_NAME }}
@@ -315,7 +315,7 @@ jobs:
315315
environment: ${{ (github.repository == 'rust-lang/rust' && 'bors') || '' }}
316316
steps:
317317
- name: checkout the source code
318-
uses: actions/checkout@v5
318+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
319319
with:
320320
fetch-depth: 2
321321
# Publish the toolstate if an auto build succeeds (just before push to the default branch)

.github/workflows/dependencies.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
runs-on: ubuntu-24.04
5252
steps:
5353
- name: checkout the source code
54-
uses: actions/checkout@v5
54+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5555
with:
5656
submodules: recursive
5757
- name: install the bootstrap toolchain
@@ -66,7 +66,7 @@ jobs:
6666
run: ./src/tools/update-lockfile.sh
6767

6868
- name: upload Cargo.lock artifact for use in PR
69-
uses: actions/upload-artifact@v7
69+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
7070
with:
7171
name: Cargo-lock
7272
path: |
@@ -75,7 +75,7 @@ jobs:
7575
src/tools/rustbook/Cargo.lock
7676
retention-days: 1
7777
- name: upload cargo-update log artifact for use in PR
78-
uses: actions/upload-artifact@v7
78+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
7979
with:
8080
name: cargo-updates
8181
path: cargo_update.log
@@ -91,14 +91,14 @@ jobs:
9191
pull-requests: write
9292
steps:
9393
- name: checkout the source code
94-
uses: actions/checkout@v5
94+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
9595

9696
- name: download Cargo.lock from update job
97-
uses: actions/download-artifact@v4
97+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
9898
with:
9999
name: Cargo-lock
100100
- name: download cargo-update log from update job
101-
uses: actions/download-artifact@v4
101+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
102102
with:
103103
name: cargo-updates
104104

.github/workflows/ghcr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
# Needed to write to the ghcr.io registry
3030
packages: write
3131
steps:
32-
- uses: actions/checkout@v5
32+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3333
with:
3434
persist-credentials: false
3535

.github/workflows/post-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
permissions:
1616
pull-requests: write
1717
steps:
18-
- uses: actions/checkout@v5
18+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1919
with:
2020
# Make sure that we have enough commits to find the parent merge commit.
2121
# Since all merges should be through merge commits, fetching two commits

0 commit comments

Comments
 (0)