Fix comments webhook panic (#12046)

* Fix webhook comment handling type cast panic

* Handle HookIssueReviewed action in webhook

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
Cornel 2020-06-25 06:39:43 +03:00 committed by GitHub
parent 9ef2f62a79
commit ebc35f2b2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 39 additions and 9 deletions

View file

@ -321,7 +321,11 @@ func GetSlackPayload(p api.Payloader, event models.HookEventType, meta string) (
case models.HookEventIssues, models.HookEventIssueAssign, models.HookEventIssueLabel, models.HookEventIssueMilestone:
return getSlackIssuesPayload(p.(*api.IssuePayload), slack)
case models.HookEventIssueComment, models.HookEventPullRequestComment:
return getSlackIssueCommentPayload(p.(*api.IssueCommentPayload), slack)
pl, ok := p.(*api.IssueCommentPayload)
if ok {
return getSlackIssueCommentPayload(pl, slack)
}
return getSlackPullRequestPayload(p.(*api.PullRequestPayload), slack)
case models.HookEventPush:
return getSlackPushPayload(p.(*api.PushPayload), slack)
case models.HookEventPullRequest, models.HookEventPullRequestAssign, models.HookEventPullRequestLabel,