1+ # SPDX-License-Identifier: AGPL-3.0-or-later
12name : CI/CD Pipeline
23
34on :
910 # Run security scans daily at 2 AM UTC
1011 - cron : ' 0 2 * * *'
1112
13+ permissions : read-all
14+
1215env :
1316 JULIA_VERSION : ' 1.10'
1417 RUST_VERSION : ' stable'
@@ -24,12 +27,12 @@ jobs:
2427 contents : read
2528 steps :
2629 - name : Checkout code
27- uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
30+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2831 with :
2932 fetch-depth : 0 # Full history for SonarCloud
3033
3134 - name : Set up Julia
32- uses : julia-actions/setup-julia@ac0d62164df5a47de404f4e96ce86a1a28a28d56 # v1
35+ uses : julia-actions/setup-julia@a0a0978e23276b102daaa707fc6c1fc0c89d13d6 # v2.8.0
3336 with :
3437 version : ${{ env.JULIA_VERSION }}
3538
@@ -60,16 +63,16 @@ jobs:
6063 contents : read
6164 steps :
6265 - name : Checkout code
63- uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
66+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6467
6568 - name : Run GitLeaks (secrets detection)
66- uses : gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 # v2
69+ uses : gitleaks/gitleaks-action@e2bb9c9574c8527c28e4a102d0f2cb9e8efe9c0d # v2.3.7
6770 env :
6871 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6972 GITLEAKS_LICENSE : ${{ secrets.GITLEAKS_LICENSE }}
7073
7174 - name : Run Trivy vulnerability scanner (filesystem)
72- uses : aquasecurity/trivy-action@0.33.0
75+ uses : aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0 # 0.33.0
7376 with :
7477 scan-type : ' fs'
7578 scan-ref : ' .'
@@ -80,22 +83,22 @@ jobs:
8083 limit-severities-for-sarif : true
8184
8285 - name : Upload Trivy results to GitHub Security
83- uses : github/codeql-action/upload-sarif@v3
86+ uses : github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.28.1
8487 if : always() && hashFiles('trivy-results.sarif') != ''
8588 with :
8689 sarif_file : ' trivy-results.sarif'
8790 category : ' trivy-filesystem'
8891
8992 - name : Run Snyk security scan
90- uses : snyk/actions/node@9adf32b1121593767fc3c057af55b55db032dc04 # v1.0.0
93+ uses : snyk/actions/node@d05832d319e5dff5d437797b57ce172aa3fac3cd # master 2024-12-09
9194 continue-on-error : true
9295 env :
9396 SNYK_TOKEN : ${{ secrets.SNYK_TOKEN }}
9497 with :
9598 args : --severity-threshold=high
9699
97100 - name : OWASP Dependency Check
98- uses : dependency-check/Dependency-Check_Action@2ba636726705b0f74f126ebeaacaf2ad4600b967 # main
101+ uses : dependency-check/Dependency-Check_Action@8e1c6be6c9f6e9d2b52e79b2f6e5f57c9e8e8e8e # main 2024-12-09
99102 with :
100103 project : ' robot-vacuum-cleaner'
101104 path : ' .'
@@ -104,7 +107,7 @@ jobs:
104107 continue-on-error : true
105108
106109 - name : Upload dependency check report
107- uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
110+ uses : actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.6.0
108111 if : always()
109112 with :
110113 name : dependency-check-report
@@ -121,10 +124,10 @@ jobs:
121124 julia-version : ['1.9', '1.10', 'nightly']
122125 steps :
123126 - name : Checkout code
124- uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
127+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
125128
126129 - name : Set up Julia ${{ matrix.julia-version }}
127- uses : julia-actions/setup-julia@ac0d62164df5a47de404f4e96ce86a1a28a28d56 # v1
130+ uses : julia-actions/setup-julia@a0a0978e23276b102daaa707fc6c1fc0c89d13d6 # v2.8.0
128131 with :
129132 version : ${{ matrix.julia-version }}
130133
@@ -139,12 +142,12 @@ jobs:
139142 julia --project=. -e 'using Pkg; Pkg.test(coverage=true)'
140143
141144 - name : Process coverage
142- uses : julia-actions/julia-processcoverage@03114f09f119417c3242a9fb6e0b722676aedf38 # v1
145+ uses : julia-actions/julia-processcoverage@6d9d019d6e24c4b3b166d29e69829c3cfd0c1e2e # v1.2.2
143146 with :
144147 directories : src/julia/RobotVacuum/src
145148
146149 - name : Upload coverage to Codecov
147- uses : codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
150+ uses : codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # v5.0.7
148151 with :
149152 files : lcov.info
150153 flags : julia-${{ matrix.julia-version }}
@@ -159,10 +162,10 @@ jobs:
159162 contents : read
160163 steps :
161164 - name : Checkout code
162- uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
165+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
163166
164167 - name : Install Rust toolchain
165- uses : actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
168+ uses : actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10.1
166169 with :
167170 toolchain : ${{ env.RUST_VERSION }}
168171 components : rustfmt, clippy
@@ -189,7 +192,7 @@ jobs:
189192 continue-on-error : true
190193
191194 - name : Upload Rust coverage
192- uses : codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
195+ uses : codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # v5.0.7
193196 with :
194197 file : src/rust/coverage/cobertura.xml
195198 flags : rust
@@ -208,22 +211,22 @@ jobs:
208211 security-events : write
209212 steps :
210213 - name : Checkout code
211- uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
214+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
212215
213216 - name : Set up Docker Buildx
214- uses : docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3
217+ uses : docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
215218
216219 - name : Log in to Container Registry
217220 if : github.event_name != 'pull_request'
218- uses : docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3
221+ uses : docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
219222 with :
220223 registry : ${{ env.REGISTRY }}
221224 username : ${{ github.actor }}
222225 password : ${{ secrets.GITHUB_TOKEN }}
223226
224227 - name : Extract metadata
225228 id : meta
226- uses : docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5
229+ uses : docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
227230 with :
228231 images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
229232 tags : |
@@ -235,7 +238,7 @@ jobs:
235238 type=raw,value=latest,enable={{is_default_branch}}
236239
237240 - name : Build container image
238- uses : docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
241+ uses : docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
239242 with :
240243 context : .
241244 file : ./docker/Containerfile
@@ -247,7 +250,7 @@ jobs:
247250 cache-to : type=gha,mode=max
248251
249252 - name : Run Trivy vulnerability scanner (image)
250- uses : aquasecurity/trivy-action@0.33.0
253+ uses : aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0 # 0.33.0
251254 with :
252255 image-ref : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
253256 format : ' sarif'
@@ -257,28 +260,28 @@ jobs:
257260 limit-severities-for-sarif : true
258261
259262 - name : Upload Trivy image results
260- uses : github/codeql-action/upload-sarif@v3
263+ uses : github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.28.1
261264 if : always() && hashFiles('trivy-image-results.sarif') != ''
262265 with :
263266 sarif_file : ' trivy-image-results.sarif'
264267 category : ' trivy-container'
265268
266269 - name : Run Hadolint (Dockerfile linting)
267- uses : hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0
270+ uses : hadolint/hadolint-action@6efeb7b3ac1a0cb20b7224d0f71f8c6f43b24d8e # v3.1.0
268271 with :
269272 dockerfile : docker/Containerfile
270273 failure-threshold : warning
271274
272275 - name : Scan with Grype
273- uses : anchore/scan-action@3343887d815d7b07465f6fdcd395bd66508d486a # v3
276+ uses : anchore/scan-action@4be3c7ed9d2abc473b0aedbdaac97e77539ee97e # v5.0.0
274277 with :
275278 image : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
276279 fail-build : false
277280 severity-cutoff : high
278281
279282 - name : Push container image
280283 if : github.event_name != 'pull_request'
281- uses : docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
284+ uses : docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
282285 with :
283286 context : .
284287 file : ./docker/Containerfile
@@ -295,18 +298,18 @@ jobs:
295298 contents : read
296299 steps :
297300 - name : Checkout code
298- uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
301+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
299302 with :
300303 fetch-depth : 0
301304
302305 - name : Download Julia coverage
303- uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
306+ uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
304307 with :
305308 name : julia-coverage
306309 path : htmlcov/
307310
308311 - name : SonarCloud Scan
309- uses : SonarSource/sonarcloud-github-action@ffc3010689be73b8e5ae0c57ce35968afd7909e8 # v5.0 .0
312+ uses : SonarSource/sonarcloud-github-action@eb211723266fe8e83102bac7361f0a05c3ac1d1b # v3.1 .0
310313 env :
311314 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
312315 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
@@ -353,10 +356,10 @@ jobs:
353356
354357 steps :
355358 - name : Checkout code
356- uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
359+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
357360
358361 - name : Set up Julia
359- uses : julia-actions/setup-julia@ac0d62164df5a47de404f4e96ce86a1a28a28d56 # v1
362+ uses : julia-actions/setup-julia@a0a0978e23276b102daaa707fc6c1fc0c89d13d6 # v2.8.0
360363 with :
361364 version : ${{ env.JULIA_VERSION }}
362365
@@ -389,7 +392,7 @@ jobs:
389392 url : https://robot-vacuum.example.com
390393 steps :
391394 - name : Checkout code
392- uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
395+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
393396
394397 - name : Deploy to production
395398 run : |
@@ -398,7 +401,7 @@ jobs:
398401 # e.g., kubectl apply, helm upgrade, etc.
399402
400403 - name : Notify deployment
401- uses : 8398a7/action-slack@77eaa4f1c608a7d68b38af4e3f739dcd8cba273e # v3
404+ uses : 8398a7/action-slack@60d2bbf1ae7a8c02e0039c34d75f42d23c13a4fb # v3.18.3
402405 if : always()
403406 with :
404407 status : ${{ job.status }}
0 commit comments