Skip to content

Commit 652dc89

Browse files
authored
Autofix GitHub Actions issue found by zizmor (#934)
2 parents d884e01 + 8b40d9d commit 652dc89

4 files changed

Lines changed: 38 additions & 22 deletions

File tree

.github/workflows/audit.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@ jobs:
2121
# Allow the action to post about found problems
2222
issues: write
2323
steps:
24-
- uses: actions/checkout@v6
25-
- uses: actions-rust-lang/audit@v1
24+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
25+
with:
26+
persist-credentials: false
27+
- uses: actions-rust-lang/audit@72c09e02f132669d52284a3323acdb503cfc1a24 # v1

.github/workflows/ci.yaml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ on:
1010
schedule:
1111
- cron: "0 0 * * 6"
1212
workflow_dispatch:
13-
permissions: read-all
13+
14+
permissions:
15+
contents: read
1416

1517
jobs:
1618
clippy_check:
@@ -21,9 +23,11 @@ jobs:
2123
rust: ["stable", "nightly"]
2224
runs-on: ${{ matrix.os }}
2325
steps:
24-
- uses: actions/checkout@v6
26+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
27+
with:
28+
persist-credentials: false
2529
- name: "Install/Update the Rust version"
26-
uses: actions-rust-lang/setup-rust-toolchain@v1
30+
uses: actions-rust-lang/setup-rust-toolchain@2b1f5e9b395427c92ee4e3331786ca3c37afe2d7 # v1
2731
with:
2832
toolchain: ${{ matrix.rust }}
2933
components: clippy
@@ -43,15 +47,17 @@ jobs:
4347
rust:
4448
- stable
4549
steps:
46-
- uses: actions/checkout@v6
50+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
51+
with:
52+
persist-credentials: false
4753
- name: "Install/Update the Rust version"
48-
uses: actions-rust-lang/setup-rust-toolchain@v1
54+
uses: actions-rust-lang/setup-rust-toolchain@2b1f5e9b395427c92ee4e3331786ca3c37afe2d7 # v1
4955
with:
5056
components: rustfmt
5157
cache: false
5258

5359
- name: Rustfmt Check (${{ matrix.rust }})
54-
uses: actions-rust-lang/rustfmt@v1
60+
uses: actions-rust-lang/rustfmt@4066006ec54a31931b9b1fddfd38f2fdf2d27143 # v1
5561

5662
build_and_test:
5763
name: Build and Test
@@ -64,9 +70,11 @@ jobs:
6470
rust: ["1.88", "1.90", "stable", "beta", "nightly"]
6571
runs-on: ${{ matrix.os }}
6672
steps:
67-
- uses: actions/checkout@v6
73+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
74+
with:
75+
persist-credentials: false
6876
- name: "Install/Update the Rust version"
69-
uses: actions-rust-lang/setup-rust-toolchain@v1
77+
uses: actions-rust-lang/setup-rust-toolchain@2b1f5e9b395427c92ee4e3331786ca3c37afe2d7 # v1
7078
with:
7179
toolchain: ${{ matrix.rust }}
7280
# Extra toolchain to test no_std
@@ -112,9 +120,11 @@ jobs:
112120
name: Test Coverage
113121
runs-on: "ubuntu-latest"
114122
steps:
115-
- uses: actions/checkout@v6
123+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
124+
with:
125+
persist-credentials: false
116126
- name: "Install/Update the Rust version"
117-
uses: actions-rust-lang/setup-rust-toolchain@v1
127+
uses: actions-rust-lang/setup-rust-toolchain@2b1f5e9b395427c92ee4e3331786ca3c37afe2d7 # v1
118128
with:
119129
toolchain: "nightly"
120130
components: "llvm-tools"
@@ -124,7 +134,7 @@ jobs:
124134
cargo install cargo-llvm-cov
125135
cargo llvm-cov --all-features --workspace --doctests --lcov --output-path lcov.info
126136
- name: Upload to codecov.io
127-
uses: codecov/codecov-action@v6
137+
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
128138
continue-on-error: true
129139
with:
130140
disable_search: true

.github/workflows/publish-crates-io.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ on:
33
push:
44
tags:
55
- "v*"
6-
permissions: read-all
6+
7+
permissions:
8+
contents: read
79

810
jobs:
911
publish_serde_with:
@@ -18,7 +20,9 @@ jobs:
1820
id-token: write
1921

2022
steps:
21-
- uses: actions/checkout@v6
23+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
24+
with:
25+
persist-credentials: false
2226
- name: "Install/Update the Rust version"
2327
run: |
2428
rustup toolchain install stable --profile minimal
@@ -31,12 +35,12 @@ jobs:
3135
shell: bash
3236
- name: Get Changelog Entry
3337
id: changelog_reader
34-
uses: mindsers/changelog-reader-action@v2
38+
uses: mindsers/changelog-reader-action@32aa5b4c155d76c94e4ec883a223c947b2f02656 # v2
3539
with:
3640
version: ${{ steps.tag_name.outputs.current_version }}
3741
path: ./serde_with/CHANGELOG.md
3842
- name: Create Release
39-
uses: softprops/action-gh-release@v2
43+
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2
4044
env:
4145
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4246
with:
@@ -47,7 +51,7 @@ jobs:
4751
body: ${{ steps.changelog_reader.outputs.changes }}
4852
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
4953
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}
50-
- uses: rust-lang/crates-io-auth-action@v1
54+
- uses: rust-lang/crates-io-auth-action@b7e9a28eded4986ec6b1fa40eeee8f8f165559ec # v1
5155
id: auth
5256
# The programs wait until the package is in the index.
5357
- run: cargo publish --package serde_with_macros

.github/workflows/scorecards-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323

2424
steps:
2525
- name: "Checkout code"
26-
uses: actions/checkout@v6
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2727
with:
2828
persist-credentials: false
2929

3030
- name: "Run analysis"
31-
uses: ossf/scorecard-action@v1.1.2
31+
uses: ossf/scorecard-action@ce330fde6b1a5c9c75b417e7efc510b822a35564 # v1.1.2
3232
with:
3333
results_file: results.sarif
3434
results_format: sarif
@@ -43,14 +43,14 @@ jobs:
4343

4444
# Upload the results as artifacts (optional).
4545
- name: "Upload artifact"
46-
uses: actions/upload-artifact@v7
46+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
4747
with:
4848
name: SARIF file
4949
path: results.sarif
5050
retention-days: 5
5151

5252
# Upload the results to GitHub's code scanning dashboard.
5353
- name: "Upload to code-scanning"
54-
uses: github/codeql-action/upload-sarif@v4
54+
uses: github/codeql-action@c10b8064de6f491fea524254123dbe5e09572f13 # v4
5555
with:
5656
sarif_file: results.sarif

0 commit comments

Comments
 (0)