mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-20 00:40:26 +00:00
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:
parent
9ef2f62a79
commit
ebc35f2b2e
8 changed files with 39 additions and 9 deletions
|
@ -183,13 +183,17 @@ func GetFeishuPayload(p api.Payloader, event models.HookEventType, meta string)
|
|||
return getFeishuForkPayload(p.(*api.ForkPayload))
|
||||
case models.HookEventIssues:
|
||||
return getFeishuIssuesPayload(p.(*api.IssuePayload))
|
||||
case models.HookEventIssueComment:
|
||||
return getFeishuIssueCommentPayload(p.(*api.IssueCommentPayload))
|
||||
case models.HookEventIssueComment, models.HookEventPullRequestComment:
|
||||
pl, ok := p.(*api.IssueCommentPayload)
|
||||
if ok {
|
||||
return getFeishuIssueCommentPayload(pl)
|
||||
}
|
||||
return getFeishuPullRequestPayload(p.(*api.PullRequestPayload))
|
||||
case models.HookEventPush:
|
||||
return getFeishuPushPayload(p.(*api.PushPayload))
|
||||
case models.HookEventPullRequest:
|
||||
return getFeishuPullRequestPayload(p.(*api.PullRequestPayload))
|
||||
case models.HookEventPullRequestReviewApproved, models.HookEventPullRequestReviewRejected, models.HookEventPullRequestComment:
|
||||
case models.HookEventPullRequestReviewApproved, models.HookEventPullRequestReviewRejected:
|
||||
return getFeishuPullRequestApprovalPayload(p.(*api.PullRequestPayload), event)
|
||||
case models.HookEventRepository:
|
||||
return getFeishuRepositoryPayload(p.(*api.RepositoryPayload))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue