Skip to content

Commit

Permalink
Fix table formatting for found vulnerabilities (#3369)
Browse files Browse the repository at this point in the history
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
  • Loading branch information
rdimitrov authored May 20, 2024
1 parent eddc285 commit 006c6fa
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions internal/engine/eval/vulncheck/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,28 +182,27 @@ const (
<blockquote>
<h3>Vulnerability scan of <code>{{slice .Report.CommitSHA 0 8 }}:</code></h3>
<ul>
<li>{{ .Symbols.bug }} <b>vulnerable packages:</b> <code>{{ $vulnerabilityCount }}</code></li>
<li>{{ .Symbols.fix }} <b>fixes available for:</b> <code>{{ $remediationCount }}</code></li>
<li>{{ .Symbols.bug }} <b>vulnerable packages:</b> <code>{{ $vulnerabilityCount }}</code></li>
<li>{{ .Symbols.fix }} <b>fixes available for:</b> <code>{{ $remediationCount }}</code></li>
</ul>
</blockquote>
{{- if .Report.TrackedDependencies }}
<table>
<tr>
<th>Package</th>
<th>Version</th>
<th>#Vulnerabilities</th>
<th>#Fixes</th>
<th>Patch</th>
</tr>
{{- range .Report.TrackedDependencies }}
<tr>
<td>{{.Dependency.Name}}</td>
<td>{{.Dependency.Version}}</td>
<td>{{len .Vulnerabilities}}</td>
<td>{{ (call $countVulnsWithFix .Vulnerabilities) }}</td>
<td>{{- if .PatchVersion }}{{.PatchVersion}}{{- else }}{{$warningSymbol}}{{- end }}</td>
</tr>
{{ end }}
<tr>
<th>Package</th>
<th>Version</th>
<th>#Vulnerabilities</th>
<th>#Fixes</th>
<th>Patch</th>
</tr>
{{- range .Report.TrackedDependencies }}
<tr>
<td>{{.Dependency.Name}}</td>
<td>{{.Dependency.Version}}</td>
<td>{{len .Vulnerabilities}}</td>
<td>{{ (call $countVulnsWithFix .Vulnerabilities) }}</td>
<td>{{- if .PatchVersion }}{{.PatchVersion}}{{- else }}{{$warningSymbol}}{{- end }}</td>
</tr>{{- end }}
</table>
{{ end -}}
`
Expand Down

0 comments on commit 006c6fa

Please sign in to comment.