mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-10-31 22:41:03 +00:00
Backport of #21400 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
46053c092d
commit
5a84558e7c
13 changed files with 74 additions and 68 deletions
|
|
@ -171,10 +171,10 @@ func (s *SlackPayload) Push(p *api.PushPayload) (api.Payloader, error) {
|
|||
commitString string
|
||||
)
|
||||
|
||||
if len(p.Commits) == 1 {
|
||||
if p.TotalCommits == 1 {
|
||||
commitDesc = "1 new commit"
|
||||
} else {
|
||||
commitDesc = fmt.Sprintf("%d new commits", len(p.Commits))
|
||||
commitDesc = fmt.Sprintf("%d new commits", p.TotalCommits)
|
||||
}
|
||||
if len(p.CompareURL) > 0 {
|
||||
commitString = SlackLinkFormatter(p.CompareURL, commitDesc)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue