Skip to content

Commit b519e47

Browse files
GiteaBotyp05327
andauthored
Fix workflow trigger event IssueChangeXXX bug (#29559) (#29565)
Backport #29559 by @yp05327 Bugs from #29308 Follow #29467 partly fix #29558 Co-authored-by: yp05327 <[email protected]>
1 parent b84303e commit b519e47

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

services/actions/notifier.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,26 @@ func (n *actionsNotifier) IssueChangeMilestone(ctx context.Context, doer *user_m
172172
} else {
173173
action = api.HookIssueDemilestoned
174174
}
175-
notifyIssueChange(ctx, doer, issue, webhook_module.HookEventPullRequestMilestone, action)
175+
176+
hookEvent := webhook_module.HookEventIssueMilestone
177+
if issue.IsPull {
178+
hookEvent = webhook_module.HookEventPullRequestMilestone
179+
}
180+
181+
notifyIssueChange(ctx, doer, issue, hookEvent, action)
176182
}
177183

178184
func (n *actionsNotifier) IssueChangeLabels(ctx context.Context, doer *user_model.User, issue *issues_model.Issue,
179185
_, _ []*issues_model.Label,
180186
) {
181187
ctx = withMethod(ctx, "IssueChangeLabels")
182-
notifyIssueChange(ctx, doer, issue, webhook_module.HookEventPullRequestLabel, api.HookIssueLabelUpdated)
188+
189+
hookEvent := webhook_module.HookEventIssueLabel
190+
if issue.IsPull {
191+
hookEvent = webhook_module.HookEventPullRequestLabel
192+
}
193+
194+
notifyIssueChange(ctx, doer, issue, hookEvent, api.HookIssueLabelUpdated)
183195
}
184196

185197
func notifyIssueChange(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, event webhook_module.HookEventType, action api.HookIssueAction) {

0 commit comments

Comments
 (0)