mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-23 07:43:18 -05:00
Backport #25144 by @Zettat123 Fix #25093 If [`WithPullRequest`](679b1f7949/services/actions/notifier_helper.go (L90-L96)
) is not called, the `Ref` in [`notifyInput`](679b1f7949/services/actions/notifier_helper.go (L55-L65)
) will be empty, so the workflows in the head branch will not be found and triggered. Co-authored-by: Zettat123 <zettat123@gmail.com> (cherry picked from commitde6ac4bf2a
)
This commit is contained in:
parent
a259a928ad
commit
a87c620d99
1 changed files with 7 additions and 0 deletions
|
@ -81,6 +81,7 @@ func (n *actionsNotifier) NotifyIssueChangeStatus(ctx context.Context, doer *use
|
||||||
newNotifyInputFromIssue(issue, webhook_module.HookEventPullRequest).
|
newNotifyInputFromIssue(issue, webhook_module.HookEventPullRequest).
|
||||||
WithDoer(doer).
|
WithDoer(doer).
|
||||||
WithPayload(apiPullRequest).
|
WithPayload(apiPullRequest).
|
||||||
|
WithPullRequest(issue.PullRequest).
|
||||||
Notify(ctx)
|
Notify(ctx)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -136,6 +137,7 @@ func (n *actionsNotifier) NotifyIssueChangeLabels(ctx context.Context, doer *use
|
||||||
Repository: convert.ToRepo(ctx, issue.Repo, perm_model.AccessModeNone),
|
Repository: convert.ToRepo(ctx, issue.Repo, perm_model.AccessModeNone),
|
||||||
Sender: convert.ToUser(ctx, doer, nil),
|
Sender: convert.ToUser(ctx, doer, nil),
|
||||||
}).
|
}).
|
||||||
|
WithPullRequest(issue.PullRequest).
|
||||||
Notify(ctx)
|
Notify(ctx)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -160,6 +162,10 @@ func (n *actionsNotifier) NotifyCreateIssueComment(ctx context.Context, doer *us
|
||||||
mode, _ := access_model.AccessLevel(ctx, doer, repo)
|
mode, _ := access_model.AccessLevel(ctx, doer, repo)
|
||||||
|
|
||||||
if issue.IsPull {
|
if issue.IsPull {
|
||||||
|
if err := issue.LoadPullRequest(ctx); err != nil {
|
||||||
|
log.Error("LoadPullRequest: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
newNotifyInputFromIssue(issue, webhook_module.HookEventPullRequestComment).
|
newNotifyInputFromIssue(issue, webhook_module.HookEventPullRequestComment).
|
||||||
WithDoer(doer).
|
WithDoer(doer).
|
||||||
WithPayload(&api.IssueCommentPayload{
|
WithPayload(&api.IssueCommentPayload{
|
||||||
|
@ -170,6 +176,7 @@ func (n *actionsNotifier) NotifyCreateIssueComment(ctx context.Context, doer *us
|
||||||
Sender: convert.ToUser(ctx, doer, nil),
|
Sender: convert.ToUser(ctx, doer, nil),
|
||||||
IsPull: true,
|
IsPull: true,
|
||||||
}).
|
}).
|
||||||
|
WithPullRequest(issue.PullRequest).
|
||||||
Notify(ctx)
|
Notify(ctx)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue