Skip to content

Commit 5f6e7e2

Browse files
committed
ci: Replace dtolnay/rust-toolchain with rustup command
This remediates both: - https://docs.zizmor.sh/audits/#unpinned-uses (one pointed to `master`). - https://docs.zizmor.sh/audits/#superfluous-actions
1 parent b1319ed commit 5f6e7e2

3 files changed

Lines changed: 9 additions & 32 deletions

File tree

.github/workflows/build.yaml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,41 +16,31 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
19-
- uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
20-
with:
21-
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
19+
- run: rustup toolchain install "${RUST_TOOLCHAIN_VERSION}"
2220
- run: cargo test --all-features
2321

2422
clippy:
2523
name: Check clippy
2624
runs-on: ubuntu-latest
2725
steps:
2826
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
29-
- uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
30-
with:
31-
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
32-
components: clippy
27+
- run: rustup toolchain install "${RUST_TOOLCHAIN_VERSION}" --component clippy
3328
- run: cargo clippy --all-targets -- -D warnings
3429

3530
fmt:
3631
name: Check formatting
3732
runs-on: ubuntu-latest
3833
steps:
3934
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
40-
- uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
41-
with:
42-
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
43-
components: rustfmt
35+
- run: rustup toolchain install "${RUST_TOOLCHAIN_VERSION}" --component rustfmt
4436
- run: cargo fmt --all -- --check
4537

4638
docs:
4739
name: Generate docs
4840
runs-on: ubuntu-latest
4941
steps:
5042
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
51-
- uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
52-
with:
53-
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
43+
- run: rustup toolchain install "${RUST_TOOLCHAIN_VERSION}"
5444
- run: cargo doc --document-private-items
5545

5646
build:

.github/workflows/pr_pre-commit.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ jobs:
1919
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
2020
with:
2121
python-version: '3.12'
22-
- uses: dtolnay/rust-toolchain@master
23-
with:
24-
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
25-
components: rustfmt,clippy
22+
- run: rustup toolchain install "${RUST_TOOLCHAIN_VERSION}" --component rustfmt,clippy
2623
- name: Setup Hadolint
2724
shell: bash
2825
run: |

.github/workflows/release.yaml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,31 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
18-
- uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
19-
with:
20-
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
18+
- run: rustup toolchain install "${RUST_TOOLCHAIN_VERSION}"
2119
- run: cargo test --all-features
2220

2321
clippy:
2422
name: Check clippy
2523
runs-on: ubuntu-latest
2624
steps:
2725
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
28-
- uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
29-
with:
30-
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
31-
components: clippy
26+
- run: rustup toolchain install "${RUST_TOOLCHAIN_VERSION}" --component clippy
3227
- run: cargo clippy --all-targets -- -D warnings
3328

3429
fmt:
3530
name: Check formatting
3631
runs-on: ubuntu-latest
3732
steps:
3833
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
39-
- uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
40-
with:
41-
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
42-
components: rustfmt
34+
- run: rustup toolchain install "${RUST_TOOLCHAIN_VERSION}" --component clippy
4335
- run: cargo fmt --all -- --check
4436

4537
docs:
4638
name: Generate docs
4739
runs-on: ubuntu-latest
4840
steps:
4941
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
50-
- uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a
51-
with:
52-
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
42+
- run: rustup toolchain install "${RUST_TOOLCHAIN_VERSION}"
5343
- run: cargo doc --document-private-items
5444

5545
docker-image:

0 commit comments

Comments
 (0)