File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -189,9 +189,13 @@ jobs:
189
189
- name : build image
190
190
run : make -j build/image/envbox
191
191
192
+ # We don't want to run Trivy on pull requests.
193
+ - name : Exit if not on main
194
+ if : github.ref != 'refs/heads/main'
195
+ run : exit 0
196
+
192
197
- name : Run Trivy vulnerability scanner
193
198
uses :
aquasecurity/[email protected]
194
- if : github.ref == 'refs/heads/main'
195
199
with :
196
200
image-ref : envbox:latest
197
201
format : sarif
@@ -200,14 +204,12 @@ jobs:
200
204
201
205
- name : Upload Trivy scan results to GitHub Security tab
202
206
uses : github/codeql-action/upload-sarif@v2
203
- if : github.ref == 'refs/heads/main'
204
207
with :
205
208
sarif_file : trivy-results.sarif
206
209
category : " Trivy"
207
210
208
211
- name : Upload Trivy scan results as an artifact
209
212
uses : actions/upload-artifact@v3
210
- if : github.ref == 'refs/heads/main'
211
213
with :
212
214
name : trivy
213
215
path : trivy-results.sarif
You can’t perform that action at this time.
0 commit comments