Trim away CR character if it exists

This is in-line with what our other webhook implementations do.
This commit is contained in:
Kemal Zebari 2024-09-04 08:44:54 -07:00
parent 21587137b9
commit af276c5b54

View File

@ -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 {