Skip to content

Commit

Permalink
feat(ci): add trivy scan
Browse files Browse the repository at this point in the history
Signed-off-by: fengshunli <1171313930@qq.com>
  • Loading branch information
fengshunli committed Jul 12, 2023
1 parent faaa302 commit 3165b56
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Trivy Scan"

on:
push:
branches:
- master
pull_request:

permissions:
contents: read

env:
IMAGE_REPO: argoproj

jobs:
images:
name: Image Scan
runs-on: ubuntu-22.04
strategy:
matrix:
target: [ argocd ]
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 0

- name: Build image
run: |
make image
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
vuln-type: 'os,library'
image-ref: '${{ matrix.target }}'
format: 'sarif'
output: 'trivy-results.sarif'
ignore-unfixed: true

- name: Upload Trivy scan results to GitHub Security
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: 'trivy-results.sarif'

0 comments on commit 3165b56

Please sign in to comment.