Update main.go
This commit is contained in:
parent
490d7fdfe4
commit
dbbe965dbf
|
@ -30,17 +30,19 @@ func init() {
|
|||
return
|
||||
}
|
||||
|
||||
contentTag := request.Status
|
||||
if len(request.Alerts.Firing()) > 0 {
|
||||
contentTag += ":" + len(request.Alerts.Firing())
|
||||
firingAlerts := len(request.Alerts.Firing())
|
||||
if firingAlerts > 0 {
|
||||
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)
|
||||
|
||||
ok := false
|
||||
for _, hook := range hooks {
|
||||
if request.Payload.VCSURL != hook.Secret {
|
||||
if request.ExternalURL != hook.Secret {
|
||||
continue
|
||||
}
|
||||
logger.Infof("run hook")
|
||||
|
|
Loading…
Reference in New Issue