Skip to content

scan

scan #782

name: scan
on:
schedule:
- cron: "0 3 * * *"
permissions: read-all
jobs:
scan-image:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: scan
runs-on: "ubuntu-22.04"
steps:
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@559eb1224e654a86c844a795e6702a0742c60c72
with:
image-ref: ghcr.io/${{ github.repository }}:latest
format: "template"
template: "@/contrib/sarif.tpl"
output: "trivy-results.sarif"
severity: "CRITICAL,HIGH"
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2
with:
sarif_file: "trivy-results.sarif"