Skip to content

Commit 1f5536d

Browse files
committed
chore(ci): refresh tool versions and improve trivy logs
Update manifest tool/runtime versions and improve Trivy diagnostics by storing report output and printing a readable vulnerability summary on failure. Made-with: Cursor
1 parent 5a2cf81 commit 1f5536d

3 files changed

Lines changed: 34 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
### Changed
1515

1616
* **security:** add CVE-2026-24051 to .trivyignore (OpenTelemetry SDK in containerd, trivy, argo)
17+
* **deps:** upgrade runner and bundled tool versions in `manifest.yaml` (runner 2.333.1, argo 4.0.4, kargo 1.9.6, pack 0.40.2, dive 0.13.1, hadolint 2.14.0, yq 4.53.2)
18+
* **ci(trivy):** write JSON report to `build/trivy-report.json` and print a human-readable vulnerability summary when scans fail
1719

1820
### Fixed
1921

manifest.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ build:
66
format: oci
77
args:
88
- RUNNER_VERSION=2.333.1
9-
- ARGO_VERSION=3.6.4
10-
- KARGO_VERSION=1.9.2
11-
- PACK_VERSION=0.36.4
12-
- DIVE_VERSION=0.12.0
13-
- HADOLINT_VERSION=2.12.0
14-
- YQ_VERSION=4.45.4
9+
- ARGO_VERSION=4.0.4
10+
- KARGO_VERSION=1.9.6
11+
- PACK_VERSION=0.40.2
12+
- DIVE_VERSION=0.13.1
13+
- HADOLINT_VERSION=2.14.0
14+
- YQ_VERSION=4.53.2
1515
labels:
1616
- org.opencontainers.image.source=https://github.com/deerhide/python-github-runner
1717
- org.opencontainers.image.description="Python GitHub Runner"

scripts/builder.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,14 @@ dive_scan() {
280280
trivy_scan () {
281281

282282
local trivy_scan_exec
283+
local trivy_scan_summary
283284
local trivy_scan_exit_code
285+
local trivy_report_file
284286

285287
log_info "Running trivy scan on ${IMAGE_NAME}:${IMAGE_TAG}"
286288
log_trace "$(trivy --version)"
289+
trivy_report_file="${BUILD_DIR}/trivy-report.json"
290+
log_info "Writing trivy report to ${trivy_report_file}"
287291

288292
set +e
289293
trivy_scan_exec=$(\
@@ -297,22 +301,44 @@ trivy_scan () {
297301
--ignorefile .trivyignore \
298302
--input ${BUILD_DIR}/${IMAGE_NAME}-${IMAGE_TAG}.tar \
299303
--format github \
304+
--output "${trivy_report_file}" \
300305
--severity HIGH,CRITICAL \
301306
--exit-code 2 \
302307
${IMAGE_NAME}:${IMAGE_TAG} \
303308
2>&1
304309
)
310+
311+
# Generate a compact human-readable summary for logs.
312+
# Keep this non-blocking so report generation/failure semantics stay unchanged.
313+
trivy_scan_summary=$(\
314+
trivy image \
315+
--scanners vuln \
316+
--ignore-unfixed \
317+
--pkg-types library \
318+
--skip-dirs /home/runner/externals \
319+
--skip-dirs /usr/local/lib/docker \
320+
--skip-files /usr/bin/dockerd \
321+
--ignorefile .trivyignore \
322+
--input ${BUILD_DIR}/${IMAGE_NAME}-${IMAGE_TAG}.tar \
323+
--severity HIGH,CRITICAL \
324+
--exit-code 0 \
325+
${IMAGE_NAME}:${IMAGE_TAG} \
326+
2>&1
327+
)
305328
# Detect exit code
306329
trivy_scan_exit_code=$?
307330
set -e
308331
if [[ $trivy_scan_exit_code -eq 2 ]]; then
309332
echo -e "${WHITE_GRAY}${trivy_scan_exec}${NC}"
333+
echo -e "${WHITE_GRAY}${trivy_scan_summary}${NC}"
310334
log_error "Trivy scan failed"
311335
exit 1
312336
elif [[ $trivy_scan_exit_code -eq 1 ]]; then
313337
echo -e "${WHITE_GRAY}${trivy_scan_exec}${NC}"
338+
echo -e "${WHITE_GRAY}${trivy_scan_summary}${NC}"
314339
log_error "Trivy scan error"
315340
else
341+
log_success "Trivy report generated at ${trivy_report_file}"
316342
log_success "Trivy scan passed"
317343
fi
318344
}

0 commit comments

Comments
 (0)