Update main.go
This commit is contained in:
parent
490d7fdfe4
commit
dbbe965dbf
|
@ -30,17 +30,19 @@ func init() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
contentTag := request.Status
|
firingAlerts := len(request.Alerts.Firing())
|
||||||
if len(request.Alerts.Firing()) > 0 {
|
if firingAlerts > 0 {
|
||||||
contentTag += ":" + len(request.Alerts.Firing())
|
content := fmt.Sprintf("[%s:%d] %s", request.Status, firingAlerts, strings.Join(request.CommonAnnotations.Values()," "))
|
||||||
|
} else {
|
||||||
|
content := fmt.Sprintf("[%s] %s", request.Status, strings.Join(request.CommonAnnotations.Values()," "))
|
||||||
}
|
}
|
||||||
|
|
||||||
content := fmt.Sprintf("[%s] %s", contentTag, strings.Join(request.CommonAnnotations.Values()," "))
|
|
||||||
logger = logger.WithField("body", content)
|
logger = logger.WithField("body", content)
|
||||||
|
|
||||||
ok := false
|
ok := false
|
||||||
for _, hook := range hooks {
|
for _, hook := range hooks {
|
||||||
if request.Payload.VCSURL != hook.Secret {
|
if request.ExternalURL != hook.Secret {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
logger.Infof("run hook")
|
logger.Infof("run hook")
|
||||||
|
|
Loading…
Reference in New Issue