fix: mail template for push event (#38467) (#38468)

Backport #38467
This commit is contained in:
wxiaoguang
2026-07-16 00:57:03 +08:00
committed by GitHub
parent 5cb7ec9304
commit bf594690db
3 changed files with 47 additions and 13 deletions
+11 -12
View File
@@ -63,19 +63,18 @@
<div>{{.RenderedContent}}</div>
</div>
{{end -}}
{{if eq .ActionName "push"}}
<ul>
{{$repoURL := $.Comment.Issue.PullRequest.BaseRepo.HTMLURL}}
{{range $commit := $.Comment.Commits}}
<li>
<a href="{{$repoURL}}/commit/{{$commit.ID}}">
{{ShortSha $commit.ID.String}}
</a> - {{$commit.MessageTitle}}
</li>
{{end}}
</ul>
{{end}}
</p>
{{if eq .ActionName "push"}}
<ul>
{{$repoURL := $.Comment.Issue.PullRequest.BaseRepo.HTMLURL}}
{{range $commit := $.Comment.Commits}}
{{$gitCommit := $commit.UserCommit.GitCommit}}
<li>
<a href="{{$repoURL}}/commit/{{$gitCommit.ID}}">{{ShortSha $gitCommit.ID.String}}</a> - {{$gitCommit.MessageTitle}}
</li>
{{end}}
</ul>
{{end}}
<div style="font-size:small; color:#666;">
<p>
---