Skip to content

Commit b43ce53

Browse files
GiteaBotZettat123
andauthored
Fix workflow trigger event bugs (#29467) (#29475)
Backport #29467 by @Zettat123 1. Fix incorrect `HookEventType` for issue-related events in `IssueChangeAssignee` 2. Add `case "types"` in the `switch` block in `matchPullRequestEvent` to avoid warning logs Co-authored-by: Zettat123 <[email protected]>
1 parent 222f938 commit b43ce53

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

modules/actions/workflows.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,9 @@ func matchPullRequestEvent(gitRepo *git.Repository, commit *git.Commit, prPayloa
441441
// all acts conditions should be satisfied
442442
for cond, vals := range acts {
443443
switch cond {
444+
case "types":
445+
// types have been checked
446+
continue
444447
case "branches":
445448
refName := git.RefName(prPayload.PullRequest.Base.Ref)
446449
patterns, err := workflowpattern.CompilePatterns(vals...)

services/actions/notifier.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,13 @@ func (n *actionsNotifier) IssueChangeAssignee(ctx context.Context, doer *user_mo
153153
} else {
154154
action = api.HookIssueAssigned
155155
}
156-
notifyIssueChange(ctx, doer, issue, webhook_module.HookEventPullRequestAssign, action)
156+
157+
hookEvent := webhook_module.HookEventIssueAssign
158+
if issue.IsPull {
159+
hookEvent = webhook_module.HookEventPullRequestAssign
160+
}
161+
162+
notifyIssueChange(ctx, doer, issue, hookEvent, action)
157163
}
158164

159165
// IssueChangeMilestone notifies assignee to notifiers

0 commit comments

Comments
 (0)