mirror of
https://github.com/safedep/vet.git
synced 2025-12-11 01:01:10 -06:00
Merge pull request #215 from r0075h3ll/main
Add 'advices' field to the generated json report file
This commit is contained in:
commit
14cde55629
@ -257,6 +257,7 @@ func (j *jsonReportGenerator) buildJsonPackageReportFromPackage(p *models.Packag
|
||||
Aliases: utils.SafelyGetValue(vuln.Aliases),
|
||||
Severities: severties,
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
for _, license := range licenses {
|
||||
@ -265,5 +266,12 @@ func (j *jsonReportGenerator) buildJsonPackageReportFromPackage(p *models.Packag
|
||||
})
|
||||
}
|
||||
|
||||
if len(pkg.Vulnerabilities) > 0 {
|
||||
pkg.Advices = append(pkg.Advices, &schema.RemediationAdvice{
|
||||
Type: schema.RemediationAdviceType_UpgradePackage,
|
||||
TargetAlternatePackageVersion: utils.SafelyGetValue(insights.PackageCurrentVersion),
|
||||
})
|
||||
}
|
||||
|
||||
return pkg
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user