Skip to content

Commit 365bc66

Browse files
authored
Merge branch 'main' into issue-212
2 parents e6f8436 + c5d890e commit 365bc66

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed

.github/workflows/build-test.yaml

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,29 @@ jobs:
3232
args: --timeout 10m --verbose --issues-exit-code=0
3333
only-new-issues: true
3434

35+
code-scan:
36+
name: Code Scan
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v4
41+
42+
- name: Run Trivy vulnerability scanner in repo mode
43+
uses: aquasecurity/trivy-action@0.28.0
44+
continue-on-error: true
45+
with:
46+
scan-type: "fs"
47+
ignore-unfixed: true
48+
exit-code: "1"
49+
format: "sarif"
50+
output: "trivy-results.sarif"
51+
severity: "CRITICAL,HIGH,MEDIUM"
52+
53+
- name: Upload Trivy scan results to GitHub Security tab
54+
uses: github/codeql-action/upload-sarif@v3
55+
with:
56+
sarif_file: "trivy-results.sarif"
57+
3558
govulncheck:
3659
runs-on: ubuntu-latest
3760
name: Run govulncheck
@@ -103,27 +126,35 @@ jobs:
103126
uses: docker/setup-buildx-action@v3
104127
with:
105128
platforms: ${{ matrix.platform }}
129+
driver: docker-container
130+
use: true
106131

107132
- name: Build Images
108133
uses: docker/build-push-action@v6
109134
with:
110135
context: .
111136
platforms: ${{ matrix.platform }}
112-
load: true
113137
push: false
114138
tags: quay.io/jetstack/version-checker:${{github.sha}}
115139
cache-from: type=gha
116140
cache-to: type=gha,mode=max
141+
# https://github.com/docker/buildx/issues/1714
142+
# Whilst trivy says it supports .tar etc, it wouldn't work in gha or locally on my machine.
143+
outputs: |-
144+
type=oci,tar=false,compression=uncompressed,dest=./.oci-image
117145
attests: |-
118-
type=sbom,generator=image
146+
type=sbom
119147
type=provenance,mode=max
120148
121149
- name: Run Trivy vulnerability scanner
122150
uses: aquasecurity/trivy-action@0.30.0
123151
with:
124-
image-ref: "quay.io/jetstack/version-checker:${{github.sha}}"
152+
input: ./.oci-image
125153
format: "table"
126154
exit-code: "1"
127155
ignore-unfixed: true
128156
vuln-type: "os,library"
129157
severity: "CRITICAL,HIGH"
158+
159+
- name: "Cleanup OCI Image from FS"
160+
run: rm -rf ./.oci-image

.github/workflows/release.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ jobs:
189189
tags: quay.io/jetstack/version-checker:${{github.ref_name}}
190190
cache-from: type=gha
191191
cache-to: type=gha,mode=max
192+
attests: |-
193+
type=sbom
194+
type=provenance,mode=max
192195
193196
github-release:
194197
name: Create/Update GitHub Release

0 commit comments

Comments
 (0)