1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Only provide the commit summary for Discord webhook push events (#32432)

Resolves #32371.

#31970 should have just showed the commit summary, but
`strings.SplitN()` was misused such that we did not perform any
splitting at all and just used the message. This was not caught in the
unit test made in that PR since the test commit summary was > 50 (which
truncated away the commit description).

This snapshot resolves this and adds another unit test to ensure that we
only show the commit summary.
This commit is contained in:
Kemal Zebari
2024-11-07 11:56:53 -08:00
committed by GitHub
parent 331e878e81
commit fb03062478
3 changed files with 17 additions and 3 deletions

View File

@@ -68,7 +68,7 @@ func pushTestPayload() *api.PushPayload {
}
func pushTestMultilineCommitMessagePayload() *api.PushPayload {
return pushTestPayloadWithCommitMessage("This is a commit summary ⚠️⚠️⚠️⚠️ containing 你好 ⚠️⚠️️\n\nThis is the message body.")
return pushTestPayloadWithCommitMessage("chore: This is a commit summary\n\nThis is a commit description.")
}
func pushTestPayloadWithCommitMessage(message string) *api.PushPayload {