test: add unit tests for cve-diff and fallback for in-build sbom scans
CI Tests / cross-check-mixed-sbom (sbom=true) (pull_request) Successful in 3m0s
CI Tests / cross-check-mixed-sbom (sbom=false) (pull_request) Successful in 3m0s
CI Tests / without-inbuild-sbom (sbom=false) (pull_request) Successful in 3m1s
CI Tests / without-inbuild-sbom (sbom=true) (pull_request) Successful in 7m14s
CI Tests / with-inbuild-sbom (sbom=false) (pull_request) Successful in 7m14s
CI Tests / with-inbuild-sbom (sbom=true) (pull_request) Successful in 7m32s
Philipp/Global-Workflows: Pre-commit Lint (Scoped) / pre-commit (pull_request) Successful in 1m29s

This commit is contained in:
Philipp committed 2026-09-14 22:27:49 +02:00
1 parent 40209bbeed
commit d89fb25d7b
10 files changed
+320 -6

No files matched your search

+5 -4
View File
@@ -84,14 +84,15 @@ function loadReportsForArg(arg) {
process.exit(1);
}
if (!data || typeof data !== 'object' || !Array.isArray(data.Results)) {
console.error(`::error::Malformed Trivy report structure (missing Results array) in: ${filePath}`);
if (!data || typeof data !== 'object') {
console.error(`::error::Malformed Trivy report structure in: ${filePath}`);
process.exit(1);
}
const results = Array.isArray(data.Results) ? data.Results : [];
loadedFiles++;
for (const result of data.Results) {
for (const result of results) {
const target = result.Target || result.Type || 'App';
const vulns = Array.isArray(result.Vulnerabilities) ? result.Vulnerabilities : [];
for (const v of vulns) {
@@ -135,7 +136,7 @@ function formatVulnRow(v, allScannedArchs = new Set(), showArch = true) {
const installed = v.InstalledVersion || '-';
const fixed = v.FixedVersion || '-';
let title = (v.Title || v.Description || '').replace(/\n/g, ' ').trim();
let title = (v.Title || v.Description || '').replace(/\n/g, ' ').replace(/\|/g, '\\|').trim();
if (title.length > 80) {
title = title.slice(0, 77) + '...';
}