Skip to content

Commit 14d71d3

Browse files
[StepSecurity] ci: Harden GitHub Actions (#616)
Signed-off-by: StepSecurity Bot <[email protected]>
1 parent 040786b commit 14d71d3

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

.github/workflows/benchmarks.yml

+24-6
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@ env:
1010
CARGO_TERM_COLOR: always
1111
CARGO_PATCH_CRATES_IO_RSONPATH_LIB_GIT: https://github.com/V0ldek/rsonpath.git
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
build:
1518
runs-on: ubuntu-latest
1619
steps:
20+
- name: Harden Runner
21+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
22+
with:
23+
egress-policy: audit
24+
1725
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1826
- name: Force remove rsonpath-lib patch from Cargo.toml
1927
run: sed -i '/^\[patch.crates-io\]/d' ./Cargo.toml && sed -i '/^rsonpath-lib = { path = .*$/d' ./Cargo.toml
@@ -36,7 +44,7 @@ jobs:
3644
target/
3745
key: cargo-${{ hashFiles('**/Cargo.toml') }}
3846
- name: Build all features
39-
uses: actions-rs/cargo@v1
47+
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
4048
with:
4149
command: build
4250
args: --all-features
@@ -47,6 +55,11 @@ jobs:
4755
name: Clippy (stable)
4856
runs-on: ubuntu-latest
4957
steps:
58+
- name: Harden Runner
59+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
60+
with:
61+
egress-policy: audit
62+
5063
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5164
- name: Force remove rsonpath-lib patch from Cargo.toml
5265
run: sed -i '/^\[patch.crates-io\]/d' ./Cargo.toml && sed -i '/^rsonpath-lib = { path = .*$/d' ./Cargo.toml
@@ -69,14 +82,14 @@ jobs:
6982
target/
7083
key: cargo-${{ hashFiles('**/Cargo.toml') }}
7184
- name: Build all features
72-
uses: actions-rs/cargo@v1
85+
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
7386
with:
7487
command: build
7588
args: --all-features
7689
env:
7790
RUSTFLAGS: "--deny warnings"
7891
- name: Clippy all features
79-
uses: actions-rs/clippy-check@v1
92+
uses: actions-rs/clippy-check@b5b5f21f4797c02da247df37026fcd0a5024aa4d # v1.0.7
8093
with:
8194
token: ${{ secrets.GITHUB_TOKEN }}
8295
args: --all-features -- --deny warnings
@@ -87,6 +100,11 @@ jobs:
87100
name: Clippy (nightly)
88101
runs-on: ubuntu-latest
89102
steps:
103+
- name: Harden Runner
104+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
105+
with:
106+
egress-policy: audit
107+
90108
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
91109
- name: Force remove rsonpath-lib patch from Cargo.toml
92110
run: sed -i '/^\[patch.crates-io\]/d' ./Cargo.toml && sed -i '/^rsonpath-lib = { path = .*$/d' ./Cargo.toml
@@ -109,21 +127,21 @@ jobs:
109127
target/
110128
key: cargo-${{ hashFiles('**/Cargo.toml') }}
111129
- name: Rustup nightly toolchain
112-
uses: actions-rs/toolchain@v1
130+
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
113131
with:
114132
toolchain: nightly
115133
components: clippy, rustfmt
116134
override: true
117135
default: true
118136
- name: Build all features
119-
uses: actions-rs/cargo@v1
137+
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
120138
with:
121139
command: build
122140
args: --all-features
123141
env:
124142
RUSTFLAGS: "--deny warnings"
125143
- name: Clippy all features
126-
uses: actions-rs/clippy-check@v1
144+
uses: actions-rs/clippy-check@b5b5f21f4797c02da247df37026fcd0a5024aa4d # v1.0.7
127145
with:
128146
token: ${{ secrets.GITHUB_TOKEN }}
129147
args: --all-features -- --deny warnings

0 commit comments

Comments
 (0)