From efa801faf7e1c176b797e30379b840b6521973ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20Kr=C3=B6ger?= Date: Mon, 19 Feb 2024 17:53:59 +0100 Subject: [PATCH] fix discord & msteams webhook url configuration (#3728) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luca Kröger --- config/config.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/config.go b/config/config.go index 7f3602e0..35cd06dd 100644 --- a/config/config.go +++ b/config/config.go @@ -516,8 +516,8 @@ func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error { if discord.HTTPConfig == nil { discord.HTTPConfig = c.Global.HTTPConfig } - if discord.WebhookURL == nil { - return fmt.Errorf("no discord webhook URL provided") + if discord.WebhookURL == nil && len(discord.WebhookURLFile) == 0 { + return fmt.Errorf("no discord webhook URL or URLFile provided") } } for _, webex := range rcv.WebexConfigs { @@ -536,8 +536,8 @@ func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error { if msteams.HTTPConfig == nil { msteams.HTTPConfig = c.Global.HTTPConfig } - if msteams.WebhookURL == nil { - return fmt.Errorf("no msteams webhook URL provided") + if msteams.WebhookURL == nil && len(msteams.WebhookURLFile) == 0 { + return fmt.Errorf("no msteams webhook URL or URLFile provided") } }