Merge pull request #996 from gano3s/dev

[issue] 995 - YAML Unmarshal error in reporting template
dev
forgedhallpass 2021-09-03 16:23:39 +03:00 committed by GitHub
commit 5e50d469e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -1,7 +1,9 @@
# to specify which severities should be reported
#allow-list:
# severity: high,critical
# severity: "critical, high"
# to specify which severities should be excluded from reporting
#deny-list:
# severity: low
# severity: "info, low, medium"
# github contains configuration options for github issue tracker
#github:

View File

@ -11,6 +11,18 @@ func (severities Severities) String() string {
return strings.Join(severities.ToStringArray(), ", ")
}
func (severities *Severities) UnmarshalYAML(unmarshal func(interface{}) error) error {
var marshalledSeverities string
if err := unmarshal(&marshalledSeverities); err != nil {
return err
}
if err := severities.Set(marshalledSeverities); err != nil {
return err
}
return nil
}
func (severities *Severities) Set(value string) error {
inputSeverities := toStringSlice(value)