Fix workflow trigger event bugs (#29467)

1. Fix incorrect `HookEventType` for issue-related events in
`IssueChangeAssignee`
2. Add `case "types"` in the `switch` block in `matchPullRequestEvent`
to avoid warning logs
pull/29474/head^2
Zettat123 9 months ago committed by GitHub
parent 82405f808d
commit 1ad4bb9eb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      modules/actions/workflows.go
  2. 8
      services/actions/notifier.go

@ -441,6 +441,9 @@ func matchPullRequestEvent(gitRepo *git.Repository, commit *git.Commit, prPayloa
// all acts conditions should be satisfied
for cond, vals := range acts {
switch cond {
case "types":
// types have been checked
continue
case "branches":
refName := git.RefName(prPayload.PullRequest.Base.Ref)
patterns, err := workflowpattern.CompilePatterns(vals...)

@ -152,7 +152,13 @@ func (n *actionsNotifier) IssueChangeAssignee(ctx context.Context, doer *user_mo
} else {
action = api.HookIssueAssigned
}
notifyIssueChange(ctx, doer, issue, webhook_module.HookEventPullRequestAssign, action)
hookEvent := webhook_module.HookEventIssueAssign
if issue.IsPull {
hookEvent = webhook_module.HookEventPullRequestAssign
}
notifyIssueChange(ctx, doer, issue, hookEvent, action)
}
// IssueChangeMilestone notifies assignee to notifiers

Loading…
Cancel
Save