grype/templates/junit.tmpl
Felix Bünemann aacf153a17
docs(templates): escape description in junit.tmpl (#2088)
Signed-off-by: Felix Bünemann <Felix.Buenemann@gmail.com>
2024-08-29 08:20:37 -04:00

14 lines
804 B
XML

<?xml version="1.0" ?>
<testsuites name="grype-junit">
{{- $failures := len $.Matches }}
<testsuite tests="{{ $failures }}" failures="{{ $failures }}" name="{{ $.Distro.Name }}:{{ $.Distro.Version }}" errors="0" skipped="0">
<properties>
<property name="type" value="{{ $.Distro.Name }}"></property>
</properties>
{{- range .Matches }}
<testcase classname="{{ .Artifact.Name }}-{{ .Artifact.Version }} ({{ .Artifact.Type }})" name="[{{ .Vulnerability.Severity }}] {{ .Vulnerability.ID }}">
<failure message="{{ .Artifact.Name }}: {{ .Vulnerability.ID }}" type="description">{{html .Vulnerability.Description }} {{ .Artifact.CPEs }} {{ .Vulnerability.DataSource }}</failure>
</testcase>
{{- end }}
</testsuite>
</testsuites>