This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (50 loc) · 1.57 KB
/
scan-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
name: Scan Image
on:
pull_request:
branches:
- main
permissions: {}
jobs:
scan-image:
name: Scan Image
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Checkout
id: checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Build Image
id: build_image
uses: docker/build-push-action@15560696de535e4014efeff63c48f16952e52dd1 # v6.2.0
with:
push: false
load: true
tags: ollamate
- name: Scan Image
id: scan_image
uses: aquasecurity/trivy-action@7c2007bcb556501da015201bcba5aa14069b74e2 # v0.23.0
with:
image-ref: ollamate
exit-code: 1
format: sarif
output: trivy-results.sarif
severity: CRITICAL
limit-severities-for-sarif: true
- name: Scan Image (On SARIF Scan Failure)
if: failure() && steps.scan_image.outcome == 'failure'
id: scan_image_on_failure
uses: aquasecurity/trivy-action@7c2007bcb556501da015201bcba5aa14069b74e2 # v0.23.0
with:
image-ref: ollamate
exit-code: 1
format: table
severity: CRITICAL
- name: Upload SARIF
if: always()
id: upload_sarif
uses: github/codeql-action/upload-sarif@b611370bb5703a7efb587f9d136a52ea24c5c38c # v2.2.7
with:
sarif_file: trivy-results.sarif