@@ -61,17 +61,32 @@ jobs:
61
61
labels : ${{ steps.meta.outputs.labels }}
62
62
cache-from : type=gha
63
63
cache-to : type=gha,mode=max
64
- - name : Run Trivy vulnerability scanner
65
- if : ${{ github.event_name != 'pull_request' }}
66
- uses :
aquasecurity/[email protected]
64
+ # - name: Run Trivy vulnerability scanner
65
+ # if: ${{ github.event_name != 'pull_request' }}
66
+ # uses: aquasecurity/[email protected]
67
+ # with:
68
+ # exit-code: '1'
69
+ # image-ref: ${{ fromJSON(steps.build.outputs.metadata)['image.name'] }}
70
+ # format: 'github'
71
+ # github-pat: ${{ github.token }}
72
+ # env:
73
+ # TRIVY_USERNAME: Username
74
+ # TRIVY_PASSWORD: Password
75
+ - name : Generate Trivy Vulnerability Report
76
+ uses : aquasecurity/trivy-action@master
67
77
with :
68
- exit-code : ' 1'
69
78
image-ref : ${{ fromJSON(steps.build.outputs.metadata)['image.name'] }}
70
- format : ' github'
71
- github-pat : ${{ github.token }}
72
- env :
73
- TRIVY_USERNAME : Username
74
- TRIVY_PASSWORD : Password
79
+ output : trivy-report.json
80
+ format : json
81
+ exit-code : 0
82
+
83
+ - name : Upload Vulnerability Scan Results
84
+ uses : actions/upload-artifact@v4
85
+ with :
86
+ name : trivy-report
87
+ path : trivy-report.json
88
+ retention-days : 30
89
+
75
90
- name : Build Docker Image
76
91
uses : docker/build-push-action@v6
77
92
id : build-and-push
0 commit comments