Skip to content

Commit fe2ec4f

Browse files
committed
ci: fix trivy workflow to correctly report scanned image
1 parent ac53d57 commit fe2ec4f

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

.github/workflows/trivy.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ permissions:
1414
jobs:
1515
build:
1616
permissions:
17-
contents: read
18-
security-events: write
17+
contents: read
18+
security-events: write
1919
actions: read
2020
name: Build
2121
runs-on: "ubuntu-latest"
@@ -25,19 +25,21 @@ jobs:
2525

2626
- name: Build an image from Dockerfile
2727
run: |
28-
docker build -t docker.io/my-organization/my-app:${{ github.sha }} .
28+
docker build -t juno:${{ github.sha }} .
29+
2930
- name: Run Trivy vulnerability scanner
30-
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 #v0.34.2
31+
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 #v0.36.0
3132
with:
32-
image-ref: 'docker.io/my-organization/my-app:${{ github.sha }}'
33+
image-ref: 'juno:${{ github.sha }}'
3334
format: 'sarif'
34-
template: '@/contrib/sarif.tpl'
3535
output: 'trivy-results.sarif'
3636
severity: 'CRITICAL,HIGH'
37+
ignore-unfixed: true
3738
env:
3839
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
3940

4041
- name: Upload Trivy scan results to GitHub Security tab
41-
uses: github/codeql-action/upload-sarif@7e3036b9cd87fc26dd06747b7aa4b96c27aaef3a #v2.19.1
42+
if: always()
43+
uses: github/codeql-action/upload-sarif@1521896cd211af95be3f02edf6f436e10b819c27 #v3.35.4
4244
with:
4345
sarif_file: 'trivy-results.sarif'

0 commit comments

Comments
 (0)