42 lines
1.1 KiB
YAML
42 lines
1.1 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@v6
|
|
|
|
- name: Retrieve Python package
|
|
uses: actions/download-artifact@v6
|
|
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@master
|
|
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@v4
|
|
with:
|
|
sarif_file: "trivy-results.sarif"
|