Skip to content

Commit 2e9d8e4

Browse files
committed
Update the way text is set
1 parent 3154c16 commit 2e9d8e4

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

main.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,25 @@ func main() {
106106
switch strings.ToLower(getEnv(EnvSlackColor)) {
107107
case "success":
108108
color = "good"
109-
text = envOr(EnvSlackOnSuccess, text) // If exists, override with on success
109+
// If exists, override with on success
110+
success_msg := envOr(EnvSlackOnSuccess, "")
111+
if success_msg != "" {
112+
text = success_msg
113+
}
110114
case "cancelled":
111115
color = "#808080"
112-
text = envOr(EnvSlackOnCancel, text) // If exists, override with on cancelled
116+
// If exists, override with on cancel
117+
cancel_msg := envOr(EnvSlackOnCancel, "")
118+
if cancel_msg != "" {
119+
text = cancel_msg
120+
}
113121
case "failure":
114122
color = "danger"
115-
text = envOr(EnvSlackOnFailure, text) // If exists, override with on failure
123+
// If exists, override with on failure
124+
failure_msg := envOr(EnvSlackOnFailure, "")
125+
if failure_msg != "" {
126+
text = failure_msg
127+
}
116128
default:
117129
color = envOr(EnvSlackColor, "good")
118130
}

0 commit comments

Comments
 (0)