Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect HookEventType of pull request review comments (#23650) #23678

Merged
merged 2 commits into from
Mar 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion services/actions/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions services/webhook/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion services/webhook/msteams.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion services/webhook/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down