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