From 06db1d1508aa3cf50a3d204a9b1fcf39422224c4 Mon Sep 17 00:00:00 2001 From: Rinat Abdullin Date: Tue, 22 Jul 2014 21:30:01 +0400 Subject: [PATCH] Tweaking slack to include commit message --- pkg/plugin/notify/slack.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkg/plugin/notify/slack.go b/pkg/plugin/notify/slack.go index 009c4538..13109ed4 100644 --- a/pkg/plugin/notify/slack.go +++ b/pkg/plugin/notify/slack.go @@ -8,9 +8,9 @@ import ( const ( slackEndpoint = "https://%s.slack.com/services/hooks/incoming-webhook?token=%s" - slackStartedMessage = "*Building* %s, commit <%s|%s>, author %s" - slackSuccessMessage = "*Success* %s, commit <%s|%s>, author %s" - slackFailureMessage = "*Failed* %s, commit <%s|%s>, author %s" + slackStartedMessage = "*Building* %s <%s|%s>, by %s:\n> %s" + slackSuccessMessage = "*Success* %s <%s|%s>, by %s:\n> %s" + slackFailureMessage = "*Failed* %s <%s|%s>, by %s:\n> %s" ) type Slack struct { @@ -47,7 +47,13 @@ func getBuildUrl(context *Context) string { func getMessage(context *Context, message string) string { url := getBuildUrl(context) - return fmt.Sprintf(message, context.Repo.Name, url, context.Commit.HashShort(), context.Commit.Author) + return fmt.Sprintf( + message, + context.Repo.Name, + url, + context.Commit.HashShort(), + context.Commit.Author, + context.Commit.Message) } func (s *Slack) sendStarted(context *Context) error {