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

Fix commit status events (#33320)

Fix #32873 
Fix #33201 
~Fix #33244~
~Fix #33302~

depends on ~#33396~

A part of this PR should be backported to v1.23 manually.
This commit is contained in:
Lunny Xiao
2025-02-03 19:25:59 -08:00
committed by GitHub
parent 3c46cd6aae
commit a4676db7dd
16 changed files with 130 additions and 0 deletions

View File

@@ -307,6 +307,18 @@ func getPackagePayloadInfo(p *api.PackagePayload, linkFormatter linkFormatter, w
return text, color
}
func getStatusPayloadInfo(p *api.CommitStatusPayload, linkFormatter linkFormatter, withSender bool) (text string, color int) {
refLink := linkFormatter(p.TargetURL, p.Context+"["+p.SHA+"]:"+p.Description)
text = fmt.Sprintf("Commit Status changed: %s", refLink)
color = greenColor
if withSender {
text += fmt.Sprintf(" by %s", linkFormatter(setting.AppURL+url.PathEscape(p.Sender.UserName), p.Sender.UserName))
}
return text, color
}
// ToHook convert models.Webhook to api.Hook
// This function is not part of the convert package to prevent an import cycle
func ToHook(repoLink string, w *webhook_model.Webhook) (*api.Hook, error) {