1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-15 23:17:19 +00:00

Fix comments webhook panic backport (#12058)

* Handle HookIssueReviewed action in webhook

* Fix webhook comment handling type cast panic
This commit is contained in:
Cornel
2020-06-26 04:19:11 +03:00
committed by GitHub
parent d059156c3a
commit 445992d929
8 changed files with 39 additions and 9 deletions

View File

@@ -408,7 +408,11 @@ func GetDiscordPayload(p api.Payloader, event models.HookEventType, meta string)
case models.HookEventIssues, models.HookEventIssueAssign, models.HookEventIssueLabel, models.HookEventIssueMilestone:
return getDiscordIssuesPayload(p.(*api.IssuePayload), discord)
case models.HookEventIssueComment, models.HookEventPullRequestComment:
return getDiscordIssueCommentPayload(p.(*api.IssueCommentPayload), discord)
pl, ok := p.(*api.IssueCommentPayload)
if ok {
return getDiscordIssueCommentPayload(pl, discord)
}
return getDiscordPullRequestPayload(p.(*api.PullRequestPayload), discord)
case models.HookEventPush:
return getDiscordPushPayload(p.(*api.PushPayload), discord)
case models.HookEventPullRequest, models.HookEventPullRequestAssign, models.HookEventPullRequestLabel,