From 211793924b2c0016e059784313c4e07bfa10de82 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Sun, 3 Mar 2024 13:56:23 +0000 Subject: [PATCH 1/2] fix --- services/actions/notifier.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/actions/notifier.go b/services/actions/notifier.go index 1e99c51a8b023..11b832f781f08 100644 --- a/services/actions/notifier.go +++ b/services/actions/notifier.go @@ -171,7 +171,13 @@ func (n *actionsNotifier) IssueChangeMilestone(ctx context.Context, doer *user_m } else { action = api.HookIssueDemilestoned } - notifyIssueChange(ctx, doer, issue, webhook_module.HookEventPullRequestMilestone, action) + + hookEvent := webhook_module.HookEventIssueMilestone + if issue.IsPull { + hookEvent = webhook_module.HookEventPullRequestMilestone + } + + notifyIssueChange(ctx, doer, issue, hookEvent, action) } func (n *actionsNotifier) IssueChangeLabels(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, From 594148f4ed166f2cedc168dff50ebd41cb1afe6f Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Sun, 3 Mar 2024 13:59:59 +0000 Subject: [PATCH 2/2] fix IssueChangeLabels --- services/actions/notifier.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/actions/notifier.go b/services/actions/notifier.go index 11b832f781f08..aa88d4e0d87b1 100644 --- a/services/actions/notifier.go +++ b/services/actions/notifier.go @@ -184,7 +184,13 @@ func (n *actionsNotifier) IssueChangeLabels(ctx context.Context, doer *user_mode _, _ []*issues_model.Label, ) { ctx = withMethod(ctx, "IssueChangeLabels") - notifyIssueChange(ctx, doer, issue, webhook_module.HookEventPullRequestLabel, api.HookIssueLabelUpdated) + + hookEvent := webhook_module.HookEventIssueLabel + if issue.IsPull { + hookEvent = webhook_module.HookEventPullRequestLabel + } + + notifyIssueChange(ctx, doer, issue, hookEvent, api.HookIssueLabelUpdated) } func notifyIssueChange(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, event webhook_module.HookEventType, action api.HookIssueAction) {