Auto-generate annotation docs (#11820)

This commit is contained in:
Ricardo Katz 2024-08-18 20:13:18 -03:00 committed by GitHub
parent eee2760907
commit cf8e374290
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 407 additions and 53 deletions

View file

@ -210,6 +210,21 @@ func StringRiskToRisk(risk string) AnnotationRisk {
}
}
func (a AnnotationRisk) ToString() string {
switch a {
case AnnotationRiskCritical:
return "Critical"
case AnnotationRiskHigh:
return "High"
case AnnotationRiskMedium:
return "Medium"
case AnnotationRiskLow:
return "Low"
default:
return "Unknown"
}
}
func normalizeString(input string) string {
trimmedContent := []string{}
for _, line := range strings.Split(input, "\n") {