Fix Slack webhook fork message (#7774)

The order of forkee and fork was mixed up.
tokarchuk/v1.17
WGH 5 years ago committed by techknowlogick
parent 0470b16e8a
commit 28c5ae27d6
  1. 4
      models/webhook_slack.go

@ -120,8 +120,8 @@ func getSlackDeletePayload(p *api.DeletePayload, slack *SlackMeta) (*SlackPayloa
// getSlackForkPayload composes Slack payload for forked by a repository. // getSlackForkPayload composes Slack payload for forked by a repository.
func getSlackForkPayload(p *api.ForkPayload, slack *SlackMeta) (*SlackPayload, error) { func getSlackForkPayload(p *api.ForkPayload, slack *SlackMeta) (*SlackPayload, error) {
baseLink := SlackLinkFormatter(p.Repo.HTMLURL, p.Repo.Name) baseLink := SlackLinkFormatter(p.Forkee.HTMLURL, p.Forkee.FullName)
forkLink := SlackLinkFormatter(p.Forkee.HTMLURL, p.Forkee.FullName) forkLink := SlackLinkFormatter(p.Repo.HTMLURL, p.Repo.FullName)
text := fmt.Sprintf("%s is forked to %s", baseLink, forkLink) text := fmt.Sprintf("%s is forked to %s", baseLink, forkLink)
return &SlackPayload{ return &SlackPayload{
Channel: slack.Channel, Channel: slack.Channel,

Loading…
Cancel
Save