Skip to content

Commit 318adac

Browse files
[StepSecurity] ci: Harden GitHub Actions
Signed-off-by: StepSecurity Bot <[email protected]>
1 parent 60d2ad5 commit 318adac

File tree

2 files changed

+35
-35
lines changed

2 files changed

+35
-35
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525
xcodebuild -version
2626
# macOS SDK version
2727
xcrun --show-sdk-version
28-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
2929
with:
3030
fetch-depth: 1
31-
- uses: actions/setup-go@v5
31+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
3232
with:
3333
go-version: 1.23.x
3434
- name: Make darwin artifacts
3535
run: make artifacts-darwin
3636
- name: "Upload artifacts"
37-
uses: actions/upload-artifact@v4
37+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
3838
with:
3939
name: artifacts-darwin
4040
path: _artifacts/
@@ -50,12 +50,12 @@ jobs:
5050
id-token: write # for provenances
5151
attestations: write # for provenances
5252
steps:
53-
- uses: actions/checkout@v4
54-
- uses: actions/download-artifact@v4
53+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
54+
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
5555
with:
5656
name: artifacts-darwin
5757
path: _artifacts/
58-
- uses: actions/setup-go@v5
58+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
5959
with:
6060
go-version: 1.23.x
6161
- name: Install gcc-x86-64-linux-gnu
@@ -101,7 +101,7 @@ jobs:
101101
- - -
102102
Release manager: [ADD YOUR NAME HERE] (@[ADD YOUR GITHUB ID HERE])
103103
EOF
104-
- uses: actions/attest-build-provenance@v1
104+
- uses: actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3
105105
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
106106
with:
107107
subject-path: _artifacts/*

.github/workflows/test.yml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323
runs-on: ubuntu-24.04
2424
timeout-minutes: 30
2525
steps:
26-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
2727
with:
2828
# To avoid "failed to load YAML file \"templates/experimental/riscv64.yaml\": can't parse builtin Lima version \"3f3a6f6\": 3f3a6f6 is not in dotted-tri format"
2929
fetch-depth: 0
30-
- uses: actions/setup-go@v5
30+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
3131
with:
3232
go-version: 1.23.x
3333
- name: Install protoc
@@ -37,7 +37,7 @@ jobs:
3737
- name: Verify generated files
3838
run: make install-tools generate check-generated
3939
- name: Run golangci-lint
40-
uses: golangci/[email protected]
40+
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
4141
with:
4242
version: v1.60.1
4343
args: --verbose --timeout=10m
@@ -48,15 +48,15 @@ jobs:
4848
sudo apt-get update
4949
sudo apt-get install -y shellcheck
5050
- name: Run file and directory name linter
51-
uses: ls-lint/[email protected]
51+
uses: ls-lint/action@1887e6c0e7f2dfa81a2d67591f0eb7782720026f # v2.2.3
5252
- name: Run shellcheck
5353
run: find . -name '*.sh' | xargs shellcheck
5454
- name: Install shfmt
5555
run: go install mvdan.cc/sh/v3/cmd/[email protected]
5656
- name: Run shfmt
5757
run: find . -name '*.sh' | xargs shfmt -s -d
5858
- name: Check hyperlinks
59-
uses: docker://dkhamsing/awesome_bot:latest
59+
uses: docker://dkhamsing/awesome_bot:latest@sha256:a8adaeb3b3bd5745304743e4d8a6d512127646e420544a6d22d9f58a07f35884
6060
with:
6161
args: /github/workspace/README.md --allow-dupe --allow-redirect --request-delay 1 --white-list https://img.shields.io,http://127.0.0.1:8080,https://github.com/lima-vm/lima/releases/download,https://xbarapp.com,https://api.github.com
6262
- name: Install go-licenses
@@ -79,10 +79,10 @@ jobs:
7979
run: |
8080
sudo apt-get update
8181
sudo apt-get install -y --no-install-recommends qemu-utils
82-
- uses: actions/checkout@v4
82+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
8383
with:
8484
fetch-depth: 1
85-
- uses: actions/setup-go@v5
85+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
8686
with:
8787
go-version: ${{ matrix.go-version }}
8888
- name: Unit tests
@@ -127,10 +127,10 @@ jobs:
127127
run: |
128128
git config --global core.autocrlf false
129129
git config --global core.eol lf
130-
- uses: actions/checkout@v4
130+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
131131
with:
132132
fetch-depth: 1
133-
- uses: actions/setup-go@v5
133+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
134134
with:
135135
go-version: 1.23.x
136136
- name: Unit tests
@@ -157,11 +157,11 @@ jobs:
157157
runs-on: macos-12
158158
timeout-minutes: 120
159159
steps:
160-
- uses: actions/checkout@v4
160+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
161161
with:
162162
# To avoid "failed to load YAML file \"templates/experimental/riscv64.yaml\": can't parse builtin Lima version \"3f3a6f6\": 3f3a6f6 is not in dotted-tri format"
163163
fetch-depth: 0
164-
- uses: actions/setup-go@v5
164+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
165165
with:
166166
go-version: 1.23.x
167167
- name: Unit tests
@@ -193,7 +193,7 @@ jobs:
193193
- name: "Show cache"
194194
run: ./hack/debug-cache.sh
195195
- name: "Test default.yaml"
196-
uses: nick-fields/retry@v3
196+
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
197197
with:
198198
timeout_minutes: 30
199199
retry_on: error
@@ -230,10 +230,10 @@ jobs:
230230
- ../hack/test-templates/alpine-iso-9p-writable.yaml # Covers alpine-iso.yaml
231231
- ../hack/test-templates/test-misc.yaml
232232
steps:
233-
- uses: actions/checkout@v4
233+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
234234
with:
235235
fetch-depth: 1
236-
- uses: actions/setup-go@v5
236+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
237237
with:
238238
go-version: 1.23.x
239239
- name: Make
@@ -267,7 +267,7 @@ jobs:
267267
run: echo "LIMACTL_CREATE_ARGS=${LIMACTL_CREATE_ARGS} --mount-type=reverse-sshfs" >>$GITHUB_ENV
268268
if: matrix.template == 'archlinux.yaml'
269269
- name: "Test"
270-
uses: nick-fields/retry@v3
270+
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
271271
with:
272272
timeout_minutes: 30
273273
retry_on: error
@@ -288,15 +288,15 @@ jobs:
288288
matrix:
289289
colima-version: ["v0.6.5"]
290290
steps:
291-
- uses: actions/checkout@v4
291+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
292292
with:
293293
# fetch-depth is set to 0 to let `limactl --version` print semver-ish version
294294
fetch-depth: 0
295295
ref: ${{ github.event.pull_request.head.sha }}
296-
- uses: actions/setup-go@v5
296+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
297297
with:
298298
go-version: 1.23.x
299-
- uses: actions/cache@v4
299+
- uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
300300
with:
301301
path: ~/.cache/lima/download
302302
key: ${{ runner.os }}-colima-${{ matrix.colima-version }}
@@ -321,7 +321,7 @@ jobs:
321321
- name: "Show cache"
322322
run: ./hack/debug-cache.sh
323323
- name: "Test"
324-
uses: nick-fields/retry@v3
324+
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
325325
with:
326326
timeout_minutes: 30
327327
retry_on: error
@@ -335,10 +335,10 @@ jobs:
335335
runs-on: macos-12
336336
timeout-minutes: 120
337337
steps:
338-
- uses: actions/checkout@v4
338+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
339339
with:
340340
fetch-depth: 1
341-
- uses: actions/setup-go@v5
341+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
342342
with:
343343
go-version: 1.23.x
344344
- name: Make
@@ -371,7 +371,7 @@ jobs:
371371
# Set -count=1 to disable cache
372372
run: go test -v -count=1 ./pkg/networks/...
373373
- name: Test socket_vmnet
374-
uses: nick-fields/retry@v3
374+
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
375375
with:
376376
timeout_minutes: 30
377377
retry_on: error
@@ -388,18 +388,18 @@ jobs:
388388
matrix:
389389
oldver: ["v0.15.1"]
390390
steps:
391-
- uses: actions/checkout@v4
391+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
392392
with:
393393
fetch-depth: 0
394394
- name: Fetch homebrew-core commit messages
395-
uses: actions/checkout@v4
395+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
396396
with:
397397
# needed by ./hack/brew-install-version.sh
398398
repository: homebrew/homebrew-core
399399
path: homebrew-core
400400
fetch-depth: 0
401401
filter: tree:0
402-
- uses: actions/setup-go@v5
402+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
403403
with:
404404
go-version: 1.23.x
405405
- name: Cache image used by ${{ matrix.oldver }}/examples/ubuntu-lts.yaml
@@ -413,7 +413,7 @@ jobs:
413413
# We revert back to 8.2.1, which seems to work fine
414414
./hack/brew-install-version.sh qemu 8.2.1
415415
- name: Test
416-
uses: nick-fields/retry@v3
416+
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
417417
with:
418418
timeout_minutes: 30
419419
retry_on: error
@@ -434,10 +434,10 @@ jobs:
434434
- default.yaml
435435
- fedora.yaml
436436
steps:
437-
- uses: actions/checkout@v4
437+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
438438
with:
439439
fetch-depth: 1
440-
- uses: actions/setup-go@v5
440+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
441441
with:
442442
go-version: 1.23.x
443443
- name: Make

0 commit comments

Comments
 (0)