Skip to content

Commit

Permalink
Fix workflow trigger event IssueChangeXXX bug (go-gitea#29559)
Browse files Browse the repository at this point in the history
Bugs from go-gitea#29308
Follow go-gitea#29467

partly fix go-gitea#29558
  • Loading branch information
yp05327 authored and GiteaBot committed Mar 3, 2024
1 parent b84303e commit 35e91e8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions services/actions/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,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) {
Expand Down

0 comments on commit 35e91e8

Please sign in to comment.