Skip to content

Commit f31f074

Browse files
authored
warn on vulnerabilities only for dev builds (#2654)
1 parent 4b66715 commit f31f074

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/build-docker.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
description: "List of flavors as key-value pair attributes"
1212
required: false
1313
type: string
14+
trivy-exit-code:
15+
description: "Exit code for Trivy when vulnerabilities are found (0 = warn only, 1 = fail)"
16+
required: false
17+
type: string
18+
default: "1"
1419

1520
env:
1621
GHCR_REPO: ghcr.io/defguard/defguard
@@ -79,7 +84,7 @@ jobs:
7984
with:
8085
image-ref: "${{ env.GHCR_REPO }}:${{ github.sha }}-${{ matrix.tag }}"
8186
format: "table"
82-
exit-code: "1"
87+
exit-code: ${{ inputs.trivy-exit-code }}
8388
ignore-unfixed: true
8489
vuln-type: "os,library"
8590
severity: "CRITICAL,HIGH,MEDIUM"

.github/workflows/current.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
tags: |
2525
type=ref,event=branch
2626
type=sha
27+
trivy-exit-code: "0"
2728

2829
trigger-e2e:
2930
needs: build-current

0 commit comments

Comments
 (0)