1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-14 22:47:21 +00:00

Fix incompleted commit status events

This commit is contained in:
Lunny Xiao
2024-12-17 18:58:23 -08:00
parent 2d7e6e9482
commit a9080fabe4
18 changed files with 110 additions and 9 deletions

View File

@ -303,6 +303,20 @@ func (m msteamsConvertor) Package(p *api.PackagePayload) (MSTeamsPayload, error)
), nil
}
func (m msteamsConvertor) CommitStatus(p *api.CommitStatusPayload) (MSTeamsPayload, error) {
text, color := getCommitStatusPayloadInfo(p, noneLinkFormatter, true)
return createMSTeamsPayload(
p.Repo,
p.Sender,
text,
"",
p.Commit.URL,
color,
&MSTeamsFact{"CommitStatus:", p.Commit.ID},
), nil
}
func createMSTeamsPayload(r *api.Repository, s *api.User, title, text, actionTarget string, color int, fact *MSTeamsFact) MSTeamsPayload {
facts := make([]MSTeamsFact, 0, 2)
if r != nil {