@@ -169,7 +169,7 @@ jobs:
169
169
with :
170
170
sarif_file : ' snyk.sarif'
171
171
scan :
172
- name : " Trivy (sarif) "
172
+ name : " Trivy"
173
173
runs-on : ubuntu-latest
174
174
needs : build
175
175
permissions :
@@ -188,40 +188,24 @@ jobs:
188
188
docker load --input /tmp/${{ env.ARTIFACT_NAME }}_prod.tar
189
189
docker image ls -a
190
190
191
- - name : Run Trivy vulnerability scanner
191
+ - name : Run Trivy vulnerability scanner (cli report)
192
+ uses : aquasecurity/trivy-action@0.24.0
193
+ with :
194
+ image-ref : ${{ env.IMAGE_NAME }}:${{ github.sha }}
195
+ format : ' table'
196
+ env :
197
+ TRIVY_DB_REPOSITORY : ${{ vars.TRIVY_DB_REPOSITORY }}
198
+
199
+ - name : Run Trivy vulnerability scanner (sarif report)
192
200
uses : aquasecurity/trivy-action@0.24.0
193
201
with :
194
202
image-ref : ${{ env.IMAGE_NAME }}:${{ github.sha }}
195
203
format : ' sarif'
196
204
output : ' trivy-results.sarif'
205
+ env :
206
+ TRIVY_DB_REPOSITORY : ${{ vars.TRIVY_DB_REPOSITORY }}
197
207
198
208
- name : Upload Trivy scan results to GitHub Security tab
199
209
uses : github/codeql-action/upload-sarif@v3
200
210
with :
201
211
sarif_file : ' trivy-results.sarif'
202
- env :
203
- ACTIONS_RUNTIME_TOKEN : ${{ secrets.GITHUB_TOKEN }}
204
-
205
- report :
206
- name : " Trivy (report)"
207
- runs-on : ubuntu-latest
208
- needs : build
209
- steps :
210
- - name : Download artifact
211
- uses : actions/download-artifact@v4
212
- with :
213
- name : ${{ env.ARTIFACT_NAME }}_prod
214
- path : /tmp/
215
-
216
- - name : Load image
217
- run : |
218
- docker load --input /tmp/${{ env.ARTIFACT_NAME }}_prod.tar
219
- docker image ls -a
220
-
221
- - name : Run Trivy vulnerability scanner
222
- uses : aquasecurity/trivy-action@0.24.0
223
- with :
224
- image-ref : ${{ env.IMAGE_NAME }}:${{ github.sha }}
225
- format : ' table'
226
- env :
227
- ACTIONS_RUNTIME_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments