ci(security): narrow Trivy code scanning upload

This commit is contained in:
Daniel Radl 2026-08-20 19:25:33 +02:00
parent f706f3a402
commit 12dadba5a8
2 changed files with 10 additions and 6 deletions

View File

@ -200,19 +200,21 @@ jobs:
summary.write("\n")
PY
- name: Upload Trivy results to code scanning on main
- name: Upload v16 amd64 build results to code scanning on main
if: >-
${{
always() &&
inputs.version == '16' &&
matrix.arch == 'amd64' &&
github.ref == 'refs/heads/main' &&
(github.event_name == 'push' || github.event_name == 'schedule') &&
hashFiles('trivy-results/*.sarif') != ''
github.event_name == 'push' &&
hashFiles('trivy-results/build.sarif') != ''
}}
continue-on-error: true
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: trivy-results
category: trivy-${{ inputs.version }}-${{ matrix.arch }}
sarif_file: trivy-results/build.sarif
category: trivy-v16-amd64-build
- name: Setup Python
uses: actions/setup-python@v7

View File

@ -77,7 +77,9 @@ During the initial rollout, Trivy is report-only:
- SARIF reports are retained as workflow artifacts for 30 days
- pull requests show a capped findings list in the workflow summary and retain
the complete SARIF reports as artifacts
- results are uploaded to GitHub Code Scanning only on pushes to `main`
- only the version 16 AMD64 `build` image report is uploaded to GitHub Code
Scanning, and only on pushes to `main`; complete reports for every image and
architecture remain available as workflow artifacts
This provides visibility before deciding which vulnerability classes should
become blocking.