Trivy Scan Image (schedule) #546
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Trivy Scan Image (schedule) | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
on: | |
schedule: | |
- cron: '30 6 * * *' | |
env: | |
REGISTRY_URL: ghcr.io | |
IMAGE_USER: djerfy | |
IMAGE_NAME: bonjourmadame-api-server | |
IMAGE_TAG: latest | |
jobs: | |
vulnerability-scanner: | |
name: Vulnerability Scanner | |
runs-on: ubuntu-latest | |
steps: | |
- name: Trivy vulnerability scanner | |
uses: aquasecurity/trivy-action@master | |
if: github.event_name != 'pull_request' | |
with: | |
image-ref: '${{ env.REGISTRY_URL }}/${{ env.IMAGE_USER }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}' | |
format: 'sarif' | |
output: 'trivy-results.sarif' | |
ignore-unfixed: 'true' | |
vuln-type: 'os,library' | |
severity: 'CRITICAL,HIGH' | |
- name: Trivy upload scan results | |
uses: github/codeql-action/upload-sarif@v3 | |
if: github.event_name != 'pull_request' | |
with: | |
sarif_file: 'trivy-results.sarif' |