Skip to content

Commit 53e1d9d

Browse files
authored
chore(ci): Pin GitHub Actions to commit SHAs (#16868)
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 → v6.0.0 - EmbarkStudios/cargo-deny-action → v2.0.15 - taiki-e/install-action → v2.75.4 - crate-ci/typos → v1.44.0 `taiki-e/install-action` was previously referenced via the `@cargo-hack` tool-specific tag, which is force-updated on every release. Pinning it requires switching to the versioned `v2.75.4` tag and passing `tool: cargo-hack` explicitly, since the versioned action.yml does not default the tool input. See https://docs.zizmor.sh/audits/#unpinned-uses (and #16867 (comment))
2 parents cb8b759 + 9bb840f commit 53e1d9d

4 files changed

Lines changed: 24 additions & 22 deletions

File tree

.github/workflows/audit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
- advisories
2222
- bans licenses sources
2323
steps:
24-
- uses: actions/checkout@v6
25-
- uses: EmbarkStudios/cargo-deny-action@v2
24+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25+
- uses: EmbarkStudios/cargo-deny-action@3fd3802e88374d3fe9159b834c7714ec57d6c979 # v2.0.15
2626
# Prevent sudden announcement of a new advisory from failing ci:
2727
continue-on-error: ${{ matrix.checks == 'advisories' }}
2828
with:

.github/workflows/contrib.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
contents: write # for Git to git push
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@v6
23+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2424
with:
2525
fetch-depth: 0
2626
- name: Install mdbook

.github/workflows/main.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
rustfmt:
5959
runs-on: ubuntu-latest
6060
steps:
61-
- uses: actions/checkout@v6
61+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6262
- run: rustup update stable && rustup default stable
6363
- run: rustup component add rustfmt
6464
- run: cargo fmt --all --check
@@ -77,30 +77,30 @@ jobs:
7777
name: Clippy ${{ matrix.name }}
7878
runs-on: ${{ matrix.os }}
7979
steps:
80-
- uses: actions/checkout@v6
80+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8181
- run: rustup update stable && rustup default stable
8282
- run: rustup component add clippy
8383
- run: cargo clippy --workspace --all-targets --no-deps -- -D warnings
8484

8585
stale-label:
8686
runs-on: ubuntu-latest
8787
steps:
88-
- uses: actions/checkout@v6
88+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8989
- run: rustup update stable && rustup default stable
9090
- run: cargo stale-label
9191

9292
lint-docs:
9393
runs-on: ubuntu-latest
9494
steps:
95-
- uses: actions/checkout@v6
95+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
9696
- run: rustup update stable && rustup default stable
9797
- run: cargo lint-docs --check
9898

9999
# Ensure Cargo.lock is up-to-date
100100
lockfile:
101101
runs-on: ubuntu-latest
102102
steps:
103-
- uses: actions/checkout@v6
103+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
104104
- run: rustup update stable && rustup default stable
105105
- run: cargo update -p cargo --locked
106106

@@ -111,7 +111,7 @@ jobs:
111111
BASE_SHA: ${{ github.event.pull_request.base.sha }}
112112
HEAD_SHA: ${{ github.event.pull_request.head.sha != '' && github.event.pull_request.head.sha || github.sha }}
113113
steps:
114-
- uses: actions/checkout@v6
114+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
115115
with:
116116
fetch-depth: 0
117117
- run: rustup update stable && rustup default stable
@@ -185,7 +185,7 @@ jobs:
185185
other: i686-pc-windows-gnu
186186
name: Tests ${{ matrix.name }}
187187
steps:
188-
- uses: actions/checkout@v6
188+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
189189
- name: Dump Environment
190190
run: ci/dump-environment.sh
191191
# Some tests require stable. Make sure it is set to the most recent stable
@@ -251,21 +251,21 @@ jobs:
251251
schema:
252252
runs-on: ubuntu-latest
253253
steps:
254-
- uses: actions/checkout@v6
254+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
255255
- run: rustup update stable && rustup default stable
256256
- run: cargo test -p cargo-util-schemas -F unstable-schema
257257

258258
resolver:
259259
runs-on: ubuntu-latest
260260
steps:
261-
- uses: actions/checkout@v6
261+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
262262
- run: rustup update stable && rustup default stable
263263
- run: cargo test -p resolver-tests
264264

265265
test_gitoxide:
266266
runs-on: ubuntu-latest
267267
steps:
268-
- uses: actions/checkout@v6
268+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
269269
- run: rustup update --no-self-update stable && rustup default stable
270270
- run: rustup target add i686-unknown-linux-gnu
271271
- run: rustup target add wasm32-unknown-unknown
@@ -278,7 +278,7 @@ jobs:
278278
build_std:
279279
runs-on: ubuntu-latest
280280
steps:
281-
- uses: actions/checkout@v6
281+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
282282
- run: rustup update nightly && rustup default nightly
283283
- run: rustup component add rust-src
284284
- run: cargo build
@@ -288,7 +288,7 @@ jobs:
288288
docs:
289289
runs-on: ubuntu-latest
290290
steps:
291-
- uses: actions/checkout@v6
291+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
292292
- run: rustup update nightly && rustup default nightly
293293
- run: rustup update stable
294294
- run: rustup component add rust-docs
@@ -316,31 +316,33 @@ jobs:
316316
msrv:
317317
runs-on: ubuntu-latest
318318
steps:
319-
- uses: actions/checkout@v6
320-
- uses: taiki-e/install-action@cargo-hack
319+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
320+
- uses: taiki-e/install-action@97a5807a604e12de3a13b52d868ebecaeeea757c # v2.75.4
321+
with:
322+
tool: cargo-hack
321323
- run: cargo hack check --all-targets --rust-version --workspace --ignore-private --locked
322324

323325
spellcheck:
324326
name: Spell Check with Typos
325327
runs-on: ubuntu-latest
326328
steps:
327329
- name: Checkout Actions Repository
328-
uses: actions/checkout@v6
330+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
329331
- name: Spell Check Repo
330-
uses: crate-ci/typos@v1.44.0
332+
uses: crate-ci/typos@631208b7aac2daa8b707f55e7331f9112b0e062d # v1.44.0
331333

332334
report-timings:
333335
name: Timing HTML report
334336
runs-on: ubuntu-latest
335337
steps:
336-
- uses: actions/checkout@v6
338+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
337339
- run: rustup update nightly && rustup default nightly
338340
- run: cargo build
339341
- name: Generate timing report for rustfix
340342
run: |
341343
cargo run -- build -p rustfix -Zbuild-analysis -Zsection-timings --config build.analysis.enabled=true --config 'build.build-dir="tmp"'
342344
cargo run -- report timings -Zbuild-analysis
343-
- uses: actions/upload-artifact@v6
345+
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
344346
with:
345347
name: timing-report
346348
path: target/cargo-timings/*.html

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727
- name: Checkout the source code
28-
uses: actions/checkout@v6
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2929

3030
- name: Publish Cargo to crates.io
3131
run: ./publish.py

0 commit comments

Comments
 (0)