summaryrefslogtreecommitdiffstats
path: root/services/actions/notifier.go
diff options
context:
space:
mode:
authoryp05327 <576951401@qq.com>2024-03-03 19:37:41 +0100
committerEarl Warren <contact@earl-warren.org>2024-03-06 05:10:47 +0100
commitaf19bae813660bf2da36ccff6dc3c93f294fca51 (patch)
tree53107a1e4d1473c3664e76018290c0cffac5c59d /services/actions/notifier.go
parentFix 500 when pushing release to an empty repo (#29554) (diff)
downloadforgejo-af19bae813660bf2da36ccff6dc3c93f294fca51.tar.xz
forgejo-af19bae813660bf2da36ccff6dc3c93f294fca51.zip
Fix workflow trigger event IssueChangeXXX bug (#29559)
Bugs from #29308 Follow #29467 partly fix #29558 (cherry picked from commit 9616dbec334aacb32c6d73b01fd749b11b1e3cdb)
Diffstat (limited to 'services/actions/notifier.go')
-rw-r--r--services/actions/notifier.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/services/actions/notifier.go b/services/actions/notifier.go
index 1e99c51a8b..aa88d4e0d8 100644
--- a/services/actions/notifier.go
+++ b/services/actions/notifier.go
@@ -171,14 +171,26 @@ 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,
_, _ []*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) {