From 97ca444df9e1ebaea6d9d2f68f570ef46190b892 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Sun, 3 Nov 2019 08:06:26 -0500 Subject: [PATCH] git: don't show empty changeset --- plugins/git/github.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/git/github.go b/plugins/git/github.go index ec09bab..c6664b2 100644 --- a/plugins/git/github.go +++ b/plugins/git/github.go @@ -36,6 +36,10 @@ func (p *GitPlugin) githubEvent(w http.ResponseWriter, r *http.Request) { repo = push.Repository.Name owner = push.Repository.Owner.Login commits := "" + if len(push.Commits) == 0 { + log.Debug().Msg("GitHub sent an empty changeset") + return + } for _, c := range push.Commits { m := strings.Split(c.Message, "\n")[0] commits += fmt.Sprintf("%s pushed to %s (<%s|%s>) %s\n",