Skip to content

Commit

Permalink
add trivy
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaqiluo committed Apr 30, 2024
1 parent f921bd4 commit 00a7be9
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/trivy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Run Trivy scan

on:
push:
tags:
- '*'
branches:
- "gha-*" # for testing
pull_request:


jobs:
trivy:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Get base image
run: |
image=$(grep hyperkube-base Dockerfile | awk '{ print $2 }')
echo "HYPERKUBE=${image}"
echo "HYPERKUBE=${image}" >> "$GITHUB_ENV"
- name: Run Trivy scanner
uses: aquasecurity/trivy-action@d710430a6722f083d3b36b8339ff66b32f22ee55 # v0.19.0
with:
image-ref: ${{ env.HYPERKUBE }}
exit-code: '1'
severity: 'CRITICAL,HIGH'

0 comments on commit 00a7be9

Please sign in to comment.