Skip to content

trivy-analysis

trivy-analysis #607

name: trivy-analysis
on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '20 13 * * 3'
permissions: {}
jobs:
build:
name: Trivy analysis
permissions:
security-events: write
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Build an image from Dockerfile
run: |
docker build -t privatebin/nginx-fpm-alpine:${{ github.sha }} .
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@v0.36.0
with:
image-ref: 'privatebin/nginx-fpm-alpine:${{ github.sha }}'
format: sarif
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: 'trivy-results.sarif'