Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
42 lines
1.3 KiB
YAML
42 lines
1.3 KiB
YAML
name: Trivy Container Scanning
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
build:
|
|
name: Build and Scan Container
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: true
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
|
|
- name: Retrieve Python package
|
|
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
|
|
with:
|
|
name: backend-dist
|
|
path: dist
|
|
|
|
# Scan the wheel that the release uses, and not a second copy that this
|
|
# job builds.
|
|
- name: Build Dockerfile
|
|
run: |
|
|
docker build -t mealie --file=./docker/Dockerfile --build-context packages=dist .
|
|
|
|
- name: Run Trivy vulnerability scanner
|
|
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
|
|
with:
|
|
ignore-unfixed: true
|
|
image-ref: "mealie"
|
|
format: "sarif"
|
|
output: "trivy-results.sarif"
|
|
env:
|
|
TRIVY_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-db,public.ecr.aws/aquasecurity/trivy-db
|
|
|
|
- name: Upload Trivy scan results to GitHub Security tab
|
|
uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4
|
|
with:
|
|
sarif_file: "trivy-results.sarif"
|