.github/workflows/trivy.yaml
name: Trivy Vulnerability Scan
run-name: 'Trivy vulnerability scan [#${{ github.event_name}} ${{ github.event.head_commit.message }}]'
on:
workflow_dispatch: {}
schedule:
- cron: '0 0 * * *'
push:
branches: [main, develop]
concurrency:
group: ${{ github.workflow }}-${{ github.sha }}
cancel-in-progress: true
jobs:
trivy:
name: Trivy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.24.0
with:
scan-type: 'fs'
ignore-unfixed: true
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'