Display total commit count in hook message (#21400)

Fixes #21379

The commits are capped by `setting.UI.FeedMaxCommitNum` so
`len(commits)` is not the correct number. So this PR adds a new
`TotalCommits` field.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
KN4CK3Randwxiaoguang authored and GitHub committed 2022-10-17 00:22:34 +08:00
1 parent 6f48a36227
commit cad9adeff4
13 files changed
+74 -68

No files matched your search

+1 -1
View File
@@ -93,7 +93,7 @@ func (f *WechatworkPayload) Push(p *api.PushPayload) (api.Payloader, error) {
for i, commit := range p.Commits {
var authorName string
if commit.Author != nil {
authorName = "Author:" + commit.Author.Name
authorName = "Author: " + commit.Author.Name
}
message := strings.ReplaceAll(commit.Message, "\n\n", "\r\n")