@@ -230,21 +230,36 @@ jobs:
230
230
files : |
231
231
build/*scan-reports.tar.gz
232
232
- name : Prepare sarif files 🔧
233
+ if : startsWith(github.ref, 'refs/tags/')
233
234
run : |
234
- mkdir trivy-sarif grype-sarif
235
- sudo mv build/*trivy.sarif trivy-sarif/
236
- sudo mv build/*grype.sarif grype-sarif/
235
+ mkdir trivy-results grype-results
236
+ trivy=$(ls build/*trivy.sarif 2>/dev/null | head -n 1)
237
+ grype=$(ls build/*grype.sarif 2>/dev/null | head -n 1)
238
+ sudo mv $trivy trivy-results/result.sarif
239
+ sudo mv $grype grype-results/result.sarif
240
+ - uses : itxaka/sarif-filter@v1
241
+ if : startsWith(github.ref, 'refs/tags/')
242
+ with :
243
+ input : trivy-results/result.sarif
244
+ output : trivy-results/result.sarif
245
+ severity : high
246
+ - uses : itxaka/sarif-filter@v1
247
+ if : startsWith(github.ref, 'refs/tags/')
248
+ with :
249
+ input : grype-results/result.sarif
250
+ output : grype-results/result.sarif
251
+ severity : high
237
252
- name : Upload Trivy scan results to GitHub Security tab
238
253
uses : github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3
239
254
if : startsWith(github.ref, 'refs/tags/')
240
255
with :
241
- sarif_file : ' trivy-sarif '
256
+ sarif_file : ' trivy-results '
242
257
category : ${{ matrix.flavor }}-${{ matrix.flavor_release }}-${{ matrix.variant }}-${{ matrix.arch }}-${{ matrix.model }}-trivy
243
258
- name : Upload Grype scan results to GitHub Security tab
244
259
uses : github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3
245
260
if : startsWith(github.ref, 'refs/tags/')
246
261
with :
247
- sarif_file : ' grype-sarif '
262
+ sarif_file : ' grype-results '
248
263
category : ${{ matrix.flavor }}-${{ matrix.flavor_release }}-${{ matrix.variant }}-${{ matrix.arch }}-${{ matrix.model }}-grype
249
264
build-arm-standard :
250
265
runs-on : ARM64
@@ -331,20 +346,34 @@ jobs:
331
346
build/*scan-reports.tar.gz
332
347
- name : Prepare sarif files 🔧
333
348
run : |
334
- mkdir trivy-sarif grype-sarif
335
- sudo mv build/*trivy.sarif trivy-sarif/
336
- sudo mv build/*grype.sarif grype-sarif/
349
+ mkdir trivy-results grype-results
350
+ trivy=$(ls build/*trivy.sarif 2>/dev/null | head -n 1)
351
+ grype=$(ls build/*grype.sarif 2>/dev/null | head -n 1)
352
+ sudo mv $trivy trivy-results/result.sarif
353
+ sudo mv $grype grype-results/result.sarif
354
+ - uses : itxaka/sarif-filter@v1
355
+ if : startsWith(github.ref, 'refs/tags/')
356
+ with :
357
+ input : trivy-results/result.sarif
358
+ output : trivy-results/result.sarif
359
+ severity : high
360
+ - uses : itxaka/sarif-filter@v1
361
+ if : startsWith(github.ref, 'refs/tags/')
362
+ with :
363
+ input : grype-results/result.sarif
364
+ output : grype-results/result.sarif
365
+ severity : high
337
366
- name : Upload Trivy scan results to GitHub Security tab
338
367
if : startsWith(github.ref, 'refs/tags/')
339
368
uses : github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3
340
369
with :
341
- sarif_file : ' trivy-sarif '
370
+ sarif_file : ' trivy-results '
342
371
category : ${{ matrix.flavor }}-${{ matrix.flavor_release }}-${{ matrix.variant }}-${{ matrix.arch }}-${{ matrix.model }}-trivy
343
372
- name : Upload Grype scan results to GitHub Security tab
344
373
if : startsWith(github.ref, 'refs/tags/')
345
374
uses : github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3
346
375
with :
347
- sarif_file : ' grype-sarif '
376
+ sarif_file : ' grype-results '
348
377
category : ${{ matrix.flavor }}-${{ matrix.flavor_release }}-${{ matrix.variant }}-${{ matrix.arch }}-${{ matrix.model }}-grype
349
378
- name : Space stats
350
379
if : always()
0 commit comments