Fix review webhooks (#8570)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:
John Olheiser 2019-10-18 03:33:19 -05:00 committed by Lunny Xiao
parent d44053eeda
commit 7c4c01c0fd
3 changed files with 40 additions and 16 deletions

View file

@ -413,7 +413,17 @@ func getDiscordPullRequestApprovalPayload(p *api.PullRequestPayload, meta *Disco
title = fmt.Sprintf("[%s] Pull request review %s: #%d %s", p.Repository.FullName, action, p.Index, p.PullRequest.Title)
text = p.PullRequest.Body
color = warnColor
switch event {
case HookEventPullRequestApproved:
color = successColor
case HookEventPullRequestRejected:
color = failedColor
case HookEventPullRequestComment:
fallthrough
default:
color = warnColor
}
}
return &DiscordPayload{