Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Improve pluralization for vulnerability count #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func QueryCves(sb *types.Sbom, cve string, workspace string, apiKey string) (*[]
return nil, errors.Wrapf(err, "failed to unmarshal response")
}
if len(result.Query.Data) > 0 {
if len(result.Query.Data) == 1 {
if len(result.Query.Data) == 1 && len(result.Query.Data[0].Cves) != 0 {
skill.Log.Infof("Detected %d vulnerability", len(result.Query.Data[0].Cves))
} else {
skill.Log.Infof("Detected %d vulnerabilities", len(result.Query.Data[0].Cves))
Expand Down