fix(parser/resultdetail): format on empty error
All checks were successful
build / build (push) Successful in 1m3s
build / trigger-build-image (push) Successful in 7s

This commit is contained in:
张泊明518370910136 2024-10-15 20:56:04 -04:00
parent 7654c7e6f3
commit 1e83ba4b87
GPG Key ID: D47306D7062CDA9D

View File

@ -33,6 +33,9 @@ func (*ResultDetail) Run(results []stage.ExecutorResult, confAny any) (
comment += fmt.Sprintf("Exit Status: `%d`\n", result.ExitStatus) comment += fmt.Sprintf("Exit Status: `%d`\n", result.ExitStatus)
} }
if conf.ShowError { if conf.ShowError {
if result.Error == "" {
result.Error = "nil"
}
comment += fmt.Sprintf("Error: `%s`\n", result.Error) comment += fmt.Sprintf("Error: `%s`\n", result.Error)
} }
if conf.ShowTime { if conf.ShowTime {