MCPcopy Create free account
hub / github.com/gogs/gogs / getSlackCreatePayload

Function getSlackCreatePayload

internal/database/webhook_slack.go:71–79  ·  view source on GitHub ↗

getSlackCreatePayload composes Slack payload for create new branch or tag.

(p *api.CreatePayload)

Source from the content-addressed store, hash-verified

69
70// getSlackCreatePayload composes Slack payload for create new branch or tag.
71func getSlackCreatePayload(p *api.CreatePayload) *SlackPayload {
72 refName := git.RefShortName(p.Ref)
73 repoLink := SlackLinkFormatter(p.Repo.HTMLURL, p.Repo.Name)
74 refLink := SlackLinkFormatter(p.Repo.HTMLURL+"/src/"+refName, refName)
75 text := fmt.Sprintf("[%s:%s] %s created by %s", repoLink, refLink, p.RefType, p.Sender.UserName)
76 return &SlackPayload{
77 Text: text,
78 }
79}
80
81// getSlackDeletePayload composes Slack payload for delete a branch or tag.
82func getSlackDeletePayload(p *api.DeletePayload) *SlackPayload {

Callers 1

GetSlackPayloadFunction · 0.85

Calls 1

SlackLinkFormatterFunction · 0.85

Tested by

no test coverage detected