fix: don't replace empty secrets (#725)

This commit is contained in:
Ryan (hackercat) 2021-06-07 13:54:12 +00:00 committed by GitHub
parent 33ccfa6f3b
commit 96a0564526
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,7 +68,9 @@ func (f *stepLogFormatter) Format(entry *logrus.Entry) ([]byte, error) {
// Replace any secrets in the entry if insecure-secrets flag is not used
if !f.insecureSecrets {
for _, v := range f.secrets {
entry.Message = strings.ReplaceAll(entry.Message, v, "***")
if v != "" {
entry.Message = strings.ReplaceAll(entry.Message, v, "***")
}
}
}