Skip to content

Commit f484490

Browse files
committed
exit if not on main
1 parent 2ce573b commit f484490

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,13 @@ jobs:
189189
- name: build image
190190
run: make -j build/image/envbox
191191

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+
192197
- name: Run Trivy vulnerability scanner
193198
uses: aquasecurity/[email protected]
194-
if: github.ref == 'refs/heads/main'
195199
with:
196200
image-ref: envbox:latest
197201
format: sarif
@@ -200,14 +204,12 @@ jobs:
200204

201205
- name: Upload Trivy scan results to GitHub Security tab
202206
uses: github/codeql-action/upload-sarif@v2
203-
if: github.ref == 'refs/heads/main'
204207
with:
205208
sarif_file: trivy-results.sarif
206209
category: "Trivy"
207210

208211
- name: Upload Trivy scan results as an artifact
209212
uses: actions/upload-artifact@v3
210-
if: github.ref == 'refs/heads/main'
211213
with:
212214
name: trivy
213215
path: trivy-results.sarif

0 commit comments

Comments
 (0)