Skip to content

Commit 46c6526

Browse files
authored
feat: use pinned action SHAs for CI workflows (#159)
Update the github actions to use pinned shas instead of major version tags. This will ensure the correct version of the action is used and protect against tag hijacking.
1 parent 497e83a commit 46c6526

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

.github/workflows/codeql.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ jobs:
4040

4141
steps:
4242
- name: Checkout repository
43-
uses: actions/checkout@v6
43+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4444

4545
- name: Install dependencies
4646
run: |
4747
sudo apt update && sudo apt install -y libcryptsetup-dev
4848
49-
- uses: actions/setup-go@v6
49+
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
5050
with:
5151
go-version-file: 'go.mod'
5252

5353
# Initializes the CodeQL tools for scanning.
5454
- name: Initialize CodeQL
55-
uses: github/codeql-action/init@v4
55+
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
5656
with:
5757
languages: ${{ matrix.language }}
5858
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -66,7 +66,7 @@ jobs:
6666
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
6767
# If this step fails, then you should remove it and run the build manually (see below)
6868
- name: Autobuild
69-
uses: github/codeql-action/autobuild@v4
69+
uses: github/codeql-action/autobuild@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
7070

7171
# ℹ️ Command-line programs to run using the OS shell.
7272
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -79,6 +79,6 @@ jobs:
7979
# ./location_of_script_within_repo/buildscript.sh
8080

8181
- name: Perform CodeQL Analysis
82-
uses: github/codeql-action/analyze@v4
82+
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
8383
with:
8484
category: "/language:${{matrix.language}}"

.github/workflows/release.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
releases_created: ${{ steps.release.outputs.releases_created }}
1717
steps:
1818
- id: release
19-
uses: googleapis/release-please-action@v4
19+
uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
2020
with:
2121
release-type: simple
2222

@@ -26,12 +26,12 @@ jobs:
2626
if: ${{ needs.release-please.outputs.releases_created == 'true' }}
2727
steps:
2828
- name: Checkout
29-
uses: actions/checkout@v6
29+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3030
with:
3131
fetch-depth: 0
3232

3333
- name: Set up Go
34-
uses: actions/setup-go@v6
34+
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
3535
with:
3636
go-version: 'stable'
3737

@@ -40,7 +40,7 @@ jobs:
4040
sudo apt update && sudo apt install -y libcryptsetup-dev
4141
4242
- name: Run GoReleaser
43-
uses: goreleaser/goreleaser-action@v7
43+
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7.0.0
4444
with:
4545
distribution: goreleaser
4646
version: "~> v2"

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
go-version: [ 'stable' ]
1616

1717
steps:
18-
- uses: actions/checkout@v6
18+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1919

2020
- name: Set up Go
21-
uses: actions/setup-go@v6
21+
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
2222
with:
2323
go-version: ${{ matrix.go-version }}
2424

0 commit comments

Comments
 (0)