feat: send to multiple notification channels if they have the same name
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful

This commit is contained in:
kekskurse 2025-08-26 12:59:30 +02:00
parent 5be3a1d4e2
commit 7c2131fe24

View file

@ -65,13 +65,11 @@ func executeJob(t time.Time, job jobconfig, c config) {
if err != nil { if err != nil {
log.Err(err).Msg("Error while Execute command") log.Err(err).Msg("Error while Execute command")
} }
nc := notificationConfig{}
for _, n := range c.Notification { for _, n := range c.Notification {
if n.Name == job.Notification { if n.Name == job.Notification {
nc = n sendNotification(result, n)
} }
} }
sendNotification(result, nc)
} }
func sendNotification(result jobResult, notification notificationConfig) error { func sendNotification(result jobResult, notification notificationConfig) error {