Skip to content

Commit

Permalink
Add trivy scanning to PR reports
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Nola <derek.nola@suse.com>
  • Loading branch information
dereknola committed Aug 27, 2024
1 parent 85e02e1 commit e4199e8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,31 @@ jobs:
. ./tests/docker/test-helpers
. ./tests/docker/test-run-${{ matrix.dtest }}
echo "Did test-run-${{ matrix.dtest }} pass $?"
trivy:
needs: build
name: Trivy Scan Image
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: "Download k3s image"
uses: actions/download-artifact@v4
with:
name: k3s
path: ./dist/artifacts
- name: Load k3s image
run: docker image load -i ./dist/artifacts/k3s-image.tar
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.20.0
with:
image-ref: 'rancher/k3s'
format: 'table'
severity: "HIGH,CRITICAL"
output: "trivy-report.txt"
- name: Add Trivy Report to PR
run: |
gh pr comment ${{ github.event.number }} --path trivy-report.txt

0 comments on commit e4199e8

Please sign in to comment.