Skip to content

Commit 517345d

Browse files
marc-barryclaude
andcommitted
feat: add Source column to vulnerability scan tables
Show the Trivy target (OS layer, binary path, package file) in the vulnerability table so users can identify where each vulnerability originates. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2ed7470 commit 517345d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/container-rescan.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ jobs:
4848
if (vulns.length === 0) {
4949
summary += '_No vulnerabilities found._\n';
5050
} else {
51-
summary += '| Library | CVE | Severity | Installed | Fixed | Title |\n|---|---|---|---|---|---|\n';
51+
summary += '| Source | Library | CVE | Severity | Installed | Fixed | Title |\n|---|---|---|---|---|---|---|\n';
5252
for (const v of vulns) {
5353
const title = (v.Title || '').replace(/\|/g, '\\|').substring(0, 80);
5454
const cve = v.PrimaryURL ? `[${v.VulnerabilityID}](${v.PrimaryURL})` : v.VulnerabilityID;
55-
summary += `| ${v.PkgName} | ${cve} | ${SEVERITY_LABEL[v.Severity] || v.Severity} | ${v.InstalledVersion} | ${v.FixedVersion || 'N/A'} | ${title} |\n`;
55+
const source = (v.target || '').replace(/\|/g, '\|');
56+
summary += `| ${source} | ${v.PkgName} | ${cve} | ${SEVERITY_LABEL[v.Severity] || v.Severity} | ${v.InstalledVersion} | ${v.FixedVersion || 'N/A'} | ${title} |\n`;
5657
}
5758
}
5859
fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, summary);

0 commit comments

Comments
 (0)