Skip to content

Commit 8d376e4

Browse files
vpeterssonclaude
andcommitted
ci: SHA-pin all external GitHub Actions
Addresses SonarCloud rule githubactions:S7637 ("Use full commit SHA hash for this dependency") and brings the repo in line with the hardened CI guidance from OpenSSF, CISA, and GitHub itself: tag refs like @v7 or @master are mutable and can be retargeted by the action owner or via compromise. Pinning to a full commit SHA removes that supply-chain risk. Every `uses:` reference to an external action across all 13 workflow files is now pinned by SHA, with the original tag preserved as an inline comment so the intent remains readable: uses: actions/checkout@de0fac2 # v6 Dependabot's github-actions ecosystem (already configured in .github/dependabot.yml) recognises this `<SHA> # <tag>` format and will update both the SHA and the comment together on future version bumps, so we don't lose automated update coverage. Scope: 21 distinct external actions × 73 total use sites across ansible-lint, build-balena-disk-image, build-webview, codeql-analysis, deploy-website, docker-build, generate-openapi-schema, javascript-lint, lint-workflows, python-lint, sbom, and test-runner. Local workflow references (./.github/workflows/...) left untouched. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 43cf1b8 commit 8d376e4

12 files changed

Lines changed: 68 additions & 68 deletions

.github/workflows/ansible-lint.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ jobs:
2727
build:
2828
runs-on: ubuntu-24.04
2929
steps:
30-
- uses: actions/checkout@v6
30+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3131

3232
- name: Set up Python 3.11
33-
uses: actions/setup-python@v6
33+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
3434
with:
3535
python-version: '3.11'
3636

3737
- name: Install uv
38-
uses: astral-sh/setup-uv@v7
38+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
3939
with:
4040
version: '0.9.17'
4141

.github/workflows/build-balena-disk-image.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: |
2525
echo ${{ inputs.docker-tag }} > docker-tag
2626
- name: Upload docker tag file
27-
uses: actions/upload-artifact@v7
27+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
2828
with:
2929
name: docker-tag
3030
path: docker-tag
@@ -45,15 +45,15 @@ jobs:
4545
attestations: write
4646
steps:
4747
- name: Checkout
48-
uses: actions/checkout@v6
48+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
4949

5050
- name: Install zstd
5151
run: |
5252
sudo apt-get update
5353
sudo apt-get install -y zstd
5454
5555
- name: Setup Node.js
56-
uses: actions/setup-node@v6
56+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
5757
with:
5858
node-version: '22.21.0'
5959

@@ -136,7 +136,7 @@ jobs:
136136
ls -la ./*raspberry*
137137
138138
- name: Upload artifacts
139-
uses: actions/upload-artifact@v7
139+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
140140
with:
141141
name: balena-images-${{ matrix.board }}
142142
path: |
@@ -145,7 +145,7 @@ jobs:
145145
./*raspberry*.json
146146
147147
- name: Attest
148-
uses: actions/attest-build-provenance@v4
148+
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4
149149
with:
150150
subject-path: '${{ github.workspace }}/*raspberry*.img.zst'
151151

@@ -156,26 +156,26 @@ jobs:
156156
contents: write
157157
steps:
158158
- name: Download docker tag
159-
uses: actions/download-artifact@v8
159+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
160160
with:
161161
name: docker-tag
162162
path: .
163163

164164
- name: Download OpenAPI schema
165-
uses: actions/download-artifact@v8
165+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
166166
with:
167167
name: anthias-api-schema
168168
path: .
169169

170170
- name: Download balena images
171-
uses: actions/download-artifact@v8
171+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
172172
with:
173173
pattern: balena-images-*
174174
path: .
175175
merge-multiple: true
176176

177177
- name: Create release
178-
uses: ncipollo/release-action@v1.21.0
178+
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
179179
with:
180180
allowUpdates: true
181181
generateReleaseNotes: true

.github/workflows/build-webview.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ jobs:
2424
runs-on: ubuntu-24.04
2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@v6
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2828

2929
- name: Set up QEMU
30-
uses: docker/setup-qemu-action@v4
30+
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4
3131

3232
- name: Set up Docker Buildx
3333
id: buildx
34-
uses: docker/setup-buildx-action@v4
34+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
3535

3636
- name: Login to Docker Hub
3737
if: success() && github.event_name != 'pull_request'
38-
uses: docker/login-action@v4
38+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
3939
with:
4040
username: ${{ secrets.DOCKER_USERNAME }}
4141
password: ${{ secrets.DOCKER_PASSWORD }}
@@ -72,17 +72,17 @@ jobs:
7272
runs-on: ubuntu-24.04
7373
steps:
7474
- name: Checkout
75-
uses: actions/checkout@v6
75+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
7676

7777
- name: Set up QEMU
78-
uses: docker/setup-qemu-action@v4
78+
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4
7979

8080
- name: Set up Docker Buildx
8181
id: buildx
82-
uses: docker/setup-buildx-action@v4
82+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
8383

8484
- name: Cache build layers
85-
uses: actions/cache@v5
85+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
8686
id: cache
8787
with:
8888
path: /tmp/.cache
@@ -123,7 +123,7 @@ jobs:
123123
~/tmp/qt-build/qt5-*.tar.gz.sha256 \
124124
./build
125125
126-
- uses: actions/upload-artifact@v7
126+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
127127
with:
128128
name: webview-${{ matrix.board }}
129129
path: ~/tmp/qt-build/
@@ -136,13 +136,13 @@ jobs:
136136
board: ['pi5', 'x86']
137137
steps:
138138
- name: Checkout
139-
uses: actions/checkout@v6
139+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
140140
- name: Set up QEMU
141-
uses: docker/setup-qemu-action@v4
141+
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4
142142

143143
- name: Set up Docker Buildx
144144
id: buildx
145-
uses: docker/setup-buildx-action@v4
145+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
146146

147147
- name: Set environment variables
148148
run: |
@@ -175,7 +175,7 @@ jobs:
175175
~/tmp-${{ matrix.board }}/build/release/webview-*.tar.gz.sha256 \
176176
./build
177177
178-
- uses: actions/upload-artifact@v7
178+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
179179
with:
180180
name: webview-${{ matrix.board }}
181181
path: ./build
@@ -195,12 +195,12 @@ jobs:
195195
id-token: write
196196
attestations: write
197197
steps:
198-
- uses: actions/download-artifact@v8
198+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
199199
with:
200200
name: webview-${{ matrix.board }}
201201
path: ./build
202202
- name: Create a release
203-
uses: softprops/action-gh-release@v3
203+
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3
204204
with:
205205
prerelease: true
206206
files: |

.github/workflows/codeql-analysis.yaml

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

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

4545
# Initializes the CodeQL tools for scanning.
4646
- name: Initialize CodeQL
47-
uses: github/codeql-action/init@v4
47+
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
4848
with:
4949
languages: ${{ matrix.language }}
5050
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -55,7 +55,7 @@ jobs:
5555
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5656
# If this step fails, then you should remove it and run the build manually (see below)
5757
- name: Autobuild
58-
uses: github/codeql-action/autobuild@v4
58+
uses: github/codeql-action/autobuild@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
5959

6060
# ℹ️ Command-line programs to run using the OS shell.
6161
# 📚 https://git.io/JvXDl
@@ -69,4 +69,4 @@ jobs:
6969
# make release
7070

7171
- name: Perform CodeQL Analysis
72-
uses: github/codeql-action/analyze@v4
72+
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4

.github/workflows/deploy-website.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ jobs:
2828
runs-on: ubuntu-latest
2929
steps:
3030
- name: Checkout
31-
uses: actions/checkout@v6
31+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3232

3333
- name: Setup Pages
34-
uses: actions/configure-pages@v6
34+
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6
3535

36-
- uses: actions/setup-python@v6
36+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
3737
with:
3838
python-version: '3.9'
3939
cache: 'pip'
@@ -59,7 +59,7 @@ jobs:
5959
find _site
6060
6161
- name: Upload artifact
62-
uses: actions/upload-pages-artifact@v5
62+
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
6363
with:
6464
path: website/_site
6565

@@ -73,4 +73,4 @@ jobs:
7373
steps:
7474
- name: Deploy to GitHub Pages
7575
id: deployment
76-
uses: actions/deploy-pages@v5
76+
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5

.github/workflows/docker-build.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ jobs:
4646

4747
steps:
4848
- name: Checkout
49-
uses: actions/checkout@v6
49+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
5050

5151
- name: Set up Python ${{ matrix.python-version }}
52-
uses: actions/setup-python@v6
52+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
5353
with:
5454
python-version: ${{ matrix.python-version }}
5555

5656
- name: Install uv
57-
uses: astral-sh/setup-uv@v7
57+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
5858
with:
5959
version: '0.9.17'
6060

@@ -64,11 +64,11 @@ jobs:
6464
uv pip install --group docker-image-builder
6565
6666
- name: Set up QEMU
67-
uses: docker/setup-qemu-action@v4
67+
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4
6868

6969
- name: Set up Docker Buildx
7070
id: buildx
71-
uses: docker/setup-buildx-action@v4
71+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
7272
with:
7373
driver-opts: |
7474
image=moby/buildkit:latest
@@ -79,7 +79,7 @@ jobs:
7979
docker buildx inspect --bootstrap
8080
8181
- name: Cache Docker layers
82-
uses: actions/cache@v5
82+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
8383
id: cache
8484
with:
8585
path: /tmp/.buildx-cache/${{ matrix.board }}-${{ matrix.service }}
@@ -93,7 +93,7 @@ jobs:
9393
9494
- name: Login to Docker Hub
9595
if: success() && github.event_name == 'push'
96-
uses: docker/login-action@v4
96+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
9797
with:
9898
username: ${{ secrets.DOCKER_USERNAME }}
9999
password: ${{ secrets.DOCKER_PASSWORD }}
@@ -121,7 +121,7 @@ jobs:
121121
runs-on: ubuntu-24.04
122122
steps:
123123
- name: Checkout
124-
uses: actions/checkout@v6
124+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
125125

126126
- name: Set Docker tag
127127
run: |
@@ -152,7 +152,7 @@ jobs:
152152
balena-deploy/docker-compose.yml
153153
fi
154154
155-
- uses: balena-io/deploy-to-balena-action@master
155+
- uses: balena-io/deploy-to-balena-action@638e3085dfe40b8c3cef2a34fe9d0874e572de4e # master
156156
id: build
157157
continue-on-error: true
158158
with:
@@ -167,7 +167,7 @@ jobs:
167167
168168
# Balena deploy often fails with 'ESOCKETTIMEDOUT'.
169169
# This adds some retry logic.
170-
- uses: balena-io/deploy-to-balena-action@master
170+
- uses: balena-io/deploy-to-balena-action@638e3085dfe40b8c3cef2a34fe9d0874e572de4e # master
171171
id: build-retry
172172
if: ${{ failure() && steps.build.conclusion == 'failure' }}
173173
with:

.github/workflows/generate-openapi-schema.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ jobs:
5656

5757
steps:
5858
- name: Checkout
59-
uses: actions/checkout@v6
59+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
6060

6161
- name: Set up Python 3.11
62-
uses: actions/setup-python@v6
62+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
6363
with:
6464
python-version: "3.11"
6565

6666
- name: Install uv
67-
uses: astral-sh/setup-uv@v7
67+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
6868
with:
6969
version: '0.9.17'
7070

@@ -74,7 +74,7 @@ jobs:
7474
uv pip install --group docker-image-builder
7575
7676
- name: Cache Docker layers
77-
uses: actions/cache@v5
77+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
7878
id: cache
7979
with:
8080
path: /tmp/.buildx-cache
@@ -102,7 +102,7 @@ jobs:
102102
--file anthias-api-schema.json
103103
104104
- name: Upload the OpenAPI Schema
105-
uses: actions/upload-artifact@v7
105+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
106106
with:
107107
name: anthias-api-schema
108108
path: anthias-api-schema.json

.github/workflows/javascript-lint.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
lint:
2525
runs-on: ubuntu-24.04
2626
steps:
27-
- uses: actions/checkout@v6
27+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2828

2929
- name: Setup Node.js
30-
uses: actions/setup-node@v6
30+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
3131
with:
3232
node-version: '20'
3333
cache: 'npm'

.github/workflows/lint-workflows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
actionlint-version: ['1.7.7']
2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@v6
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2929

3030
- name: Download actionlint
3131
run: |

0 commit comments

Comments
 (0)