Skip to content

Commit

Permalink
analysis: set success when vulnerability is not of type Vulnerability
Browse files Browse the repository at this point in the history
This commit will be used to solve ZupIT/horusec#615 and other repositories in security step to show vulnerabilities but not fail the pipeline

Signed-off-by: Ian Cardoso <ian.cardoso@zup.com.br>
  • Loading branch information
iancardosozup committed Sep 30, 2021
1 parent 91f5a65 commit 87dea63
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/entities/analysis/analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package analysis

import (
"encoding/json"
"github.com/ZupIT/horusec-devkit/pkg/enums/vulnerability"
"time"

"github.com/google/uuid"
Expand Down Expand Up @@ -121,7 +122,12 @@ func (a *Analysis) SetFinishedData() {
}

func (a *Analysis) HasErrors() bool {
return len(a.Errors) > 0
for _, vuln := range a.AnalysisVulnerabilities {
if vuln.Vulnerability.Type == vulnerability.Vulnerability {
return true
}
}
return false
}

func (a *Analysis) GetTotalVulnerabilities() int {
Expand Down

0 comments on commit 87dea63

Please sign in to comment.