Skip to content

Commit 35e91e8

Browse files
yp05327GiteaBot
authored andcommitted
Fix workflow trigger event IssueChangeXXX bug (go-gitea#29559)
Bugs from go-gitea#29308 Follow go-gitea#29467 partly fix go-gitea#29558
1 parent b84303e commit 35e91e8

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