Skip to content

Commit 9616dbe

Browse files
authored
Fix workflow trigger event IssueChangeXXX bug (#29559)
Bugs from #29308 Follow #29467 partly fix #29558
1 parent 6e2aafd commit 9616dbe

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

services/actions/notifier.go

+14-2
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,26 @@ func (n *actionsNotifier) IssueChangeMilestone(ctx context.Context, doer *user_m
171171
} else {
172172
action = api.HookIssueDemilestoned
173173
}
174-
notifyIssueChange(ctx, doer, issue, webhook_module.HookEventPullRequestMilestone, action)
174+
175+
hookEvent := webhook_module.HookEventIssueMilestone
176+
if issue.IsPull {
177+
hookEvent = webhook_module.HookEventPullRequestMilestone
178+
}
179+
180+
notifyIssueChange(ctx, doer, issue, hookEvent, action)
175181
}
176182

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

184196
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)