mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-03-03 15:02:35 +02:00
fix(codeqlExecuteScan): check for compliance for Audit All (#4796)
Co-authored-by: sumeet patil <sumeet.patil@sap.com>
This commit is contained in:
parent
33b8c489f9
commit
4be7b99f95
@ -399,10 +399,12 @@ func runCodeqlExecuteScan(config *codeqlExecuteScanOptions, telemetryData *telem
|
|||||||
|
|
||||||
if config.CheckForCompliance {
|
if config.CheckForCompliance {
|
||||||
for _, scanResult := range scanResults {
|
for _, scanResult := range scanResults {
|
||||||
unaudited := scanResult.Total - scanResult.Audited
|
if scanResult.ClassificationName == codeql.AuditAll {
|
||||||
if unaudited > config.VulnerabilityThresholdTotal {
|
unaudited := scanResult.Total - scanResult.Audited
|
||||||
msg := fmt.Sprintf("Your repository %v with ref %v is not compliant. Total unaudited issues are %v which is greater than the VulnerabilityThresholdTotal count %v", repoUrl, repoInfo.Ref, unaudited, config.VulnerabilityThresholdTotal)
|
if unaudited > config.VulnerabilityThresholdTotal {
|
||||||
return reports, errors.Errorf(msg)
|
msg := fmt.Sprintf("Your repository %v with ref %v is not compliant. Total unaudited issues are %v which is greater than the VulnerabilityThresholdTotal count %v", repoUrl, repoInfo.Ref, unaudited, config.VulnerabilityThresholdTotal)
|
||||||
|
return reports, errors.Errorf(msg)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user