aboutsummaryrefslogtreecommitdiffstats
path: root/modules/webhook/dingtalk.go
diff options
context:
space:
mode:
authorCornel <github@codejuggle.dj>2020-06-25 06:39:43 +0300
committerGitHub <noreply@github.com>2020-06-24 23:39:43 -0400
commitebc35f2b2e700b30d288b622cd9409a0f741e928 (patch)
treea332c8ec927a1e05f9b87b2056acbe47085c092a /modules/webhook/dingtalk.go
parent9ef2f62a799f02ac7960eb3039af9229ec682c55 (diff)
downloadgitea-ebc35f2b2e700b30d288b622cd9409a0f741e928.tar.gz
gitea-ebc35f2b2e700b30d288b622cd9409a0f741e928.zip
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>
Diffstat (limited to 'modules/webhook/dingtalk.go')
-rw-r--r--modules/webhook/dingtalk.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/webhook/dingtalk.go b/modules/webhook/dingtalk.go
index f2dd5a79ed..4e0e52451a 100644
--- a/modules/webhook/dingtalk.go
+++ b/modules/webhook/dingtalk.go
@@ -264,7 +264,11 @@ func GetDingtalkPayload(p api.Payloader, event models.HookEventType, meta string
case models.HookEventIssues, models.HookEventIssueAssign, models.HookEventIssueLabel, models.HookEventIssueMilestone:
return getDingtalkIssuesPayload(p.(*api.IssuePayload))
case models.HookEventIssueComment, models.HookEventPullRequestComment:
- return getDingtalkIssueCommentPayload(p.(*api.IssueCommentPayload))
+ pl, ok := p.(*api.IssueCommentPayload)
+ if ok {
+ return getDingtalkIssueCommentPayload(pl)
+ }
+ return getDingtalkPullRequestPayload(p.(*api.PullRequestPayload))
case models.HookEventPush:
return getDingtalkPushPayload(p.(*api.PushPayload))
case models.HookEventPullRequest, models.HookEventPullRequestAssign, models.HookEventPullRequestLabel,