mirror of
https://github.com/seerr-team/seerr.git
synced 2026-06-16 12:30:37 -04:00
62 lines
1.6 KiB
YAML
62 lines
1.6 KiB
YAML
---
|
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
|
name: Trivy Container Vulnerability Scan
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows:
|
|
- Seerr Release
|
|
types:
|
|
- completed
|
|
schedule:
|
|
- cron: '50 7 * * 5'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
trivy:
|
|
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
|
|
name: Scan latest container image
|
|
runs-on: ubuntu-24.04
|
|
|
|
permissions:
|
|
contents: read
|
|
security-events: write
|
|
|
|
env:
|
|
TRIVY_CACHE_DIR: .trivycache
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- name: Cache Trivy DB
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
path: .trivycache
|
|
key: trivy-${{ runner.os }}-${{ hashFiles('**/Dockerfile') }}
|
|
restore-keys: |
|
|
trivy-${{ runner.os }}-
|
|
|
|
- name: Run Trivy image scan
|
|
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
|
|
with:
|
|
image-ref: ghcr.io/${{ github.repository }}:latest
|
|
format: sarif
|
|
output: trivy.sarif
|
|
ignore-unfixed: true
|
|
|
|
- name: Upload SARIF to code scanning
|
|
uses: github/codeql-action/upload-sarif@87557b9c84dde89fdd9b10e88954ac2f4248e463 # v4.36.1
|
|
with:
|
|
sarif_file: trivy.sarif
|