From af276c5b5490fe688edd06e6846b02e34e427bf5 Mon Sep 17 00:00:00 2001 From: Kemal Zebari Date: Wed, 4 Sep 2024 08:44:54 -0700 Subject: [PATCH] Trim away CR character if it exists This is in-line with what our other webhook implementations do. --- services/webhook/discord.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/webhook/discord.go b/services/webhook/discord.go index 5eb96e7b48..8c50dcf968 100644 --- a/services/webhook/discord.go +++ b/services/webhook/discord.go @@ -155,7 +155,7 @@ func (d discordConvertor) Push(p *api.PushPayload) (DiscordPayload, error) { // for each commit, generate attachment text for i, commit := range p.Commits { // limit the commit message display to just the summary, otherwise it would be hard to read - message := strings.Split(commit.Message, "\n")[0] + message := strings.TrimRight(strings.Split(commit.Message, "\n")[0], "\r") // a limit of 50 is set because GitHub does the same if len(message) > 50 {