Skip to content

Commit f2db53b

Browse files
[StepSecurity] ci: Harden GitHub Actions
Signed-off-by: StepSecurity Bot <[email protected]>
1 parent 9a0ffc4 commit f2db53b

File tree

6 files changed

+36
-36
lines changed

6 files changed

+36
-36
lines changed

.github/workflows/benchmark.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ jobs:
3535
# For pushes to main, compare against the previous commit
3636
BRANCH_NAME: ${{ github.event_name == 'pull_request' && github.base_ref || github.event.before }}
3737
steps:
38-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3939
with:
4040
fetch-depth: 10 # Fetch current commit and its parent
41-
- uses: arduino/setup-protoc@v3
41+
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
4242
with:
4343
repo-token: ${{ secrets.GITHUB_TOKEN }}
44-
- uses: dtolnay/rust-toolchain@master
44+
- uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0 # master
4545
with:
4646
toolchain: stable
47-
- uses: boa-dev/criterion-compare-action@v3
47+
- uses: boa-dev/criterion-compare-action@adfd3a94634fe2041ce5613eb7df09d247555b87 # v3.2.4
4848
with:
4949
branchName: ${{ env.BRANCH_NAME }}

.github/workflows/ci.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,33 +36,33 @@ jobs:
3636
sudo rm -rf /usr/local/lib/android
3737
sudo rm -rf /usr/share/dotnet
3838
df -h
39-
- uses: actions/checkout@v4
39+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4040
with:
4141
submodules: true
42-
- uses: dtolnay/rust-toolchain@master
42+
- uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0 # master
4343
with:
4444
toolchain: ${{ matrix.rust }}
4545
components: rustfmt
4646
- name: "Set rustup profile"
4747
run: rustup set profile minimal
48-
- uses: arduino/setup-protoc@v3
48+
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
4949
with:
5050
repo-token: ${{ secrets.GITHUB_TOKEN }}
5151
- name: Test
5252
run: bash ./scripts/test.sh
5353
lint:
5454
runs-on: ubuntu-latest
5555
steps:
56-
- uses: actions/checkout@v4
56+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5757
with:
5858
submodules: true
59-
- uses: dtolnay/rust-toolchain@stable
59+
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
6060
with:
6161
components: rustfmt, clippy
62-
- uses: taiki-e/install-action@v2
62+
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc # v2.49.45
6363
with:
6464
tool: cargo-hack
65-
- uses: arduino/setup-protoc@v3
65+
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
6666
with:
6767
repo-token: ${{ secrets.GITHUB_TOKEN }}
6868
- name: Format
@@ -75,8 +75,8 @@ jobs:
7575
example: [opentelemetry, opentelemetry-sdk, opentelemetry-otlp, opentelemetry-zipkin]
7676
runs-on: ubuntu-latest # TODO: Check if this could be covered for Windows. The step used currently fails on Windows.
7777
steps:
78-
- uses: actions/checkout@v4
79-
- uses: dtolnay/rust-toolchain@nightly
78+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
79+
- uses: dtolnay/rust-toolchain@a02741459ec5e501b9843ed30b535ca0a0376ae4 # nightly
8080
with:
8181
toolchain: nightly-2024-06-30
8282
components: rustfmt
@@ -93,11 +93,11 @@ jobs:
9393
runs-on: ${{ matrix.os }}
9494
continue-on-error: true
9595
steps:
96-
- uses: actions/checkout@v4
96+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
9797
with:
9898
submodules: true
9999
- name: Set up Rust ${{ matrix.rust }}
100-
uses: dtolnay/rust-toolchain@master
100+
uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0 # master
101101
with:
102102
toolchain: ${{ matrix.rust }}
103103
- name: Patch dependencies versions
@@ -108,19 +108,19 @@ jobs:
108108
runs-on: ubuntu-latest # This uses the step `EmbarkStudios/cargo-deny-action@v1` which is only supported on Linux
109109
continue-on-error: true # Prevent sudden announcement of a new advisory from failing ci
110110
steps:
111-
- uses: actions/checkout@v4
112-
- uses: EmbarkStudios/cargo-deny-action@v2
111+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
112+
- uses: EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 # v2.0.11
113113
with:
114114
command: check advisories
115115
docs:
116116
continue-on-error: true
117117
runs-on: ubuntu-latest
118118
steps:
119-
- uses: actions/checkout@v4
120-
- uses: dtolnay/rust-toolchain@stable
119+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
120+
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
121121
with:
122122
components: rustfmt
123-
- uses: arduino/setup-protoc@v3
123+
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
124124
with:
125125
repo-token: ${{ secrets.GITHUB_TOKEN }}
126126
- name: doc
@@ -133,25 +133,25 @@ jobs:
133133
runs-on: ubuntu-latest
134134
if: ${{ ! contains(github.event.pull_request.labels.*.name, 'dependencies') }}
135135
steps:
136-
- uses: actions/checkout@v4
136+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
137137
with:
138138
submodules: true
139-
- uses: dtolnay/rust-toolchain@stable
139+
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
140140
with:
141141
toolchain: stable
142142
components: rustfmt,llvm-tools-preview
143-
- uses: arduino/setup-protoc@v3
143+
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
144144
with:
145145
repo-token: ${{ secrets.GITHUB_TOKEN }}
146146
- name: cargo install cargo-llvm-cov
147-
uses: taiki-e/install-action@cargo-llvm-cov
147+
uses: taiki-e/install-action@5075451c95db43b063f20f0c8fef04c04d5bf0ba # cargo-llvm-cov
148148
- name: cargo generate-lockfile
149149
if: hashFiles('Cargo.lock') == ''
150150
run: cargo generate-lockfile
151151
- name: cargo llvm-cov
152152
run: cargo llvm-cov --locked --all-features --workspace --lcov --lib --output-path lcov.info
153153
- name: Upload to codecov.io
154-
uses: codecov/codecov-action@v4
154+
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
155155
env:
156156
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
157157
with:
@@ -160,13 +160,13 @@ jobs:
160160
continue-on-error: true
161161
runs-on: ubuntu-latest
162162
steps:
163-
- uses: actions/checkout@v4
163+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
164164
with:
165165
submodules: true
166-
- uses: dtolnay/rust-toolchain@master
166+
- uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0 # master
167167
with:
168168
toolchain: stable
169-
- uses: taiki-e/install-action@v2
169+
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc # v2.49.45
170170
with:
171171
tool: cargo-machete
172172
- name: cargo machete

.github/workflows/integration_tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ jobs:
1616
sudo rm -rf /usr/local/lib/android
1717
sudo rm -rf /usr/share/dotnet
1818
df -h
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2020
with:
2121
submodules: true
22-
- uses: dtolnay/rust-toolchain@stable
22+
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
2323
with:
2424
components: rustfmt
25-
- uses: arduino/setup-protoc@v3
25+
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
2626
with:
2727
repo-token: ${{ secrets.GITHUB_TOKEN }}
2828
- name: Run integration tests

.github/workflows/markdown-link-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
markdown-link-check:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1919

2020
- name: Install markdown-link-check
2121
run: npm install -g [email protected]

.github/workflows/pr_naming.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: PR Conventional Commit Validation
12-
uses: ytanikin/[email protected]
12+
uses: ytanikin/pr-conventional-commits@8267db1bacc237419f9ed0228bb9d94e94271a1d # 1.4.1
1313
with:
1414
task_types: '["build","chore","ci","docs","feat","fix","perf","refactor","revert","test"]'
1515
add_label: 'false'

.github/workflows/semver.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ jobs:
1010
timeout-minutes: 10
1111
if: ${{ github.event.label.name == 'semver-check' || contains(github.event.pull_request.labels.*.name, 'semver-check') }}
1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1414
with:
1515
submodules: true
1616
- name: Install stable
17-
uses: dtolnay/rust-toolchain@stable
17+
uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
1818
with:
1919
components: rustfmt
2020
- name: cargo-semver-checks
21-
uses: obi1kenobi/[email protected]
21+
uses: obi1kenobi/cargo-semver-checks-action@7272cc2caa468d3e009a2b0a9cc366839348237b # v2.6

0 commit comments

Comments
 (0)