Skip to content

Trivy - ghcr image scan - master #1173

Trivy - ghcr image scan - master

Trivy - ghcr image scan - master #1173

# Trivy: Scan remote image on GHCR on schedule
# Trivy (pronunciation) is a comprehensive and versatile security scanner.
# Trivy has scanners that look for security issues,
# and targets where it can find those issues.
# https://github.com/aquasecurity/trivy
# ---------------------------------
name: Trivy - ghcr image scan - master
on:
schedule:
- cron: "0 7,15 * * *"
jobs:
scan:
permissions:
contents: read
security-events: write
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: master
- name: Ensure lowercase name
run: echo REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr "[:upper:]" "[:lower:]") >> $GITHUB_ENV
- name: Run Trivy on latest release image
uses: aquasecurity/[email protected]
with:
image-ref: "ghcr.io/${{ env.REPOSITORY_OWNER }}/dds-backend:latest"
format: "sarif"
output: "trivy-results-master.sarif"
severity: "CRITICAL,HIGH"
- name: Upload Trivy scan results to master branch GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results-master.sarif"
category: trivy-master