From 1950d91d9aa7bc4ea54ad0698767856c3363757a Mon Sep 17 00:00:00 2001 From: viktor-kurchenko <69600804+viktor-kurchenko@users.noreply.github.com> Date: Wed, 29 Mar 2023 18:08:41 +0300 Subject: [PATCH] Slack fixed. (#6) Signed-off-by: viktor-kurchenko <69600804+viktor-kurchenko@users.noreply.github.com> --- pkg/slack/slack.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/slack/slack.go b/pkg/slack/slack.go index d82d267..17af283 100644 --- a/pkg/slack/slack.go +++ b/pkg/slack/slack.go @@ -29,6 +29,10 @@ func Notify(resourceFile, url, title string) error { if err := report.ReadFromFile(resourceFile); err != nil { return err } + if len(report.Accounts) == 0 { + log.Println("Nothing to send...") + return nil + } log.Println("Preparing slack messages...") messages := reportToSlackMessages(title, report) log.Println("Sending slack notification...")