Skip to content

Commit

Permalink
Create at most just 1 substring when splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
kemzeb committed Sep 17, 2024
1 parent 3cc4fd6 commit 0983b27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion services/webhook/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,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.TrimRight(strings.Split(commit.Message, "\n")[0], "\r")
message := strings.TrimRight(strings.SplitN(commit.Message, "\n", 1)[0], "\r")

// a limit of 50 is set because GitHub does the same
if utf8.RuneCountInString(message) > 50 {
Expand Down

0 comments on commit 0983b27

Please sign in to comment.