Skip to content

Commit

Permalink
test
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 a164678
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/trivy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: PR Comment Triggered Trivy Scan

on:
issue_comment:
types: [created]

jobs:
trivy_scan:
if: github.event.issue.pull_request && github.event.comment.body == '/trivy'
runs-on: ubuntu-latest
permissions:
pull-requests: write
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Checkout PR code
uses: actions/checkout@v4
with:
ref: ${{ github.event.issue.pull_request.head.ref }}

- name: Build K3s Image
run: make package-image

- 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.issue.number }} -F trivy-report.txt

0 comments on commit a164678

Please sign in to comment.