Skip to content

Commit

Permalink
chore: only upload trivy results for main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
sreya committed Nov 26, 2024
1 parent 2f74185 commit 2ce573b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ jobs:

- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
if: github.ref == 'refs/heads/main'
with:
image-ref: envbox:latest
format: sarif
Expand All @@ -199,12 +200,14 @@ jobs:

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

- name: Upload Trivy scan results as an artifact
uses: actions/upload-artifact@v3
if: github.ref == 'refs/heads/main'
with:
name: trivy
path: trivy-results.sarif
Expand Down

0 comments on commit 2ce573b

Please sign in to comment.