]> source.dussan.org Git - gitea.git/commitdiff
Fix incorrect `HookEventType` of pull request review comments (#23650) (#23678)
authorGiteabot <teabot@gitea.io>
Sat, 25 Mar 2023 00:56:15 +0000 (20:56 -0400)
committerGitHub <noreply@github.com>
Sat, 25 Mar 2023 00:56:15 +0000 (20:56 -0400)
Backport #23650 by @Zettat123

`HookEventType` of pull request review comments should be
`HookEventPullRequestReviewComment` but some event types are
`HookEventPullRequestComment` now.

Co-authored-by: Zettat123 <zettat123@gmail.com>
services/actions/notifier.go
services/webhook/discord.go
services/webhook/msteams.go
services/webhook/notifier.go

index cdf9087fef16818cda059adafd64a4dba62d67ed..90eed83eff5e1bbc0c5f7f9bc67fea942cd2e43f 100644 (file)
@@ -264,7 +264,7 @@ func (n *actionsNotifier) NotifyPullRequestReview(ctx context.Context, pr *issue
        case issues_model.ReviewTypeApprove:
                reviewHookType = webhook_module.HookEventPullRequestReviewApproved
        case issues_model.ReviewTypeComment:
-               reviewHookType = webhook_module.HookEventPullRequestComment
+               reviewHookType = webhook_module.HookEventPullRequestReviewComment
        case issues_model.ReviewTypeReject:
                reviewHookType = webhook_module.HookEventPullRequestReviewRejected
        default:
index 014d409ce732600ee6a22077ed891c3c1ef0c511..02f0fb87205339ab8172e71075540b736252dcd0 100644 (file)
@@ -209,7 +209,7 @@ func (d *DiscordPayload) Review(p *api.PullRequestPayload, event webhook_module.
                        color = greenColor
                case webhook_module.HookEventPullRequestReviewRejected:
                        color = redColor
-               case webhook_module.HookEventPullRequestComment:
+               case webhook_module.HookEventPullRequestReviewComment:
                        color = greyColor
                default:
                        color = yellowColor
@@ -277,7 +277,7 @@ func parseHookPullRequestEventType(event webhook_module.HookEventType) (string,
                return "approved", nil
        case webhook_module.HookEventPullRequestReviewRejected:
                return "rejected", nil
-       case webhook_module.HookEventPullRequestComment:
+       case webhook_module.HookEventPullRequestReviewComment:
                return "comment", nil
 
        default:
index 03d92821b9eb3545ac65c4b50b2100911c9d7eae..60ef334ded9ac45c9697527e7af89bdf9587b7c4 100644 (file)
@@ -223,7 +223,7 @@ func (m *MSTeamsPayload) Review(p *api.PullRequestPayload, event webhook_module.
                        color = greenColor
                case webhook_module.HookEventPullRequestReviewRejected:
                        color = redColor
-               case webhook_module.HookEventPullRequestComment:
+               case webhook_module.HookEventPullRequestReviewComment:
                        color = greyColor
                default:
                        color = yellowColor
index b023717cd258e6669f4d5649cf166b51eba98d94..1f7cb8d988a38ae5e111a84ba65bd0bb07412fde 100644 (file)
@@ -685,7 +685,7 @@ func (m *webhookNotifier) NotifyPullRequestReview(ctx context.Context, pr *issue
        case issues_model.ReviewTypeApprove:
                reviewHookType = webhook_module.HookEventPullRequestReviewApproved
        case issues_model.ReviewTypeComment:
-               reviewHookType = webhook_module.HookEventPullRequestComment
+               reviewHookType = webhook_module.HookEventPullRequestReviewComment
        case issues_model.ReviewTypeReject:
                reviewHookType = webhook_module.HookEventPullRequestReviewRejected
        default: