diff options
author | Zettat123 <zettat123@gmail.com> | 2023-06-11 09:06:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-11 09:06:43 +0800 |
commit | 15d238d321d016f94410e60f30d5cef22d8185e8 (patch) | |
tree | 9da39b4a62febbd527999a8c9b91b7c0878e094a | |
parent | c17423e0a18b21812b524cb5dc5fbdda2d3ed9df (diff) | |
download | gitea-15d238d321d016f94410e60f30d5cef22d8185e8.tar.gz gitea-15d238d321d016f94410e60f30d5cef22d8185e8.zip |
Add `WithPullRequest` for `actionsNotifier` (#25144)
-rw-r--r-- | services/actions/notifier.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/services/actions/notifier.go b/services/actions/notifier.go index 48eec5283b..536b430b41 100644 --- a/services/actions/notifier.go +++ b/services/actions/notifier.go @@ -81,6 +81,7 @@ func (n *actionsNotifier) NotifyIssueChangeStatus(ctx context.Context, doer *use newNotifyInputFromIssue(issue, webhook_module.HookEventPullRequest). WithDoer(doer). WithPayload(apiPullRequest). + WithPullRequest(issue.PullRequest). Notify(ctx) return } @@ -136,6 +137,7 @@ func (n *actionsNotifier) NotifyIssueChangeLabels(ctx context.Context, doer *use Repository: convert.ToRepo(ctx, issue.Repo, perm_model.AccessModeNone), Sender: convert.ToUser(ctx, doer, nil), }). + WithPullRequest(issue.PullRequest). Notify(ctx) return } @@ -160,6 +162,10 @@ func (n *actionsNotifier) NotifyCreateIssueComment(ctx context.Context, doer *us mode, _ := access_model.AccessLevel(ctx, doer, repo) if issue.IsPull { + if err := issue.LoadPullRequest(ctx); err != nil { + log.Error("LoadPullRequest: %v", err) + return + } newNotifyInputFromIssue(issue, webhook_module.HookEventPullRequestComment). WithDoer(doer). WithPayload(&api.IssueCommentPayload{ @@ -170,6 +176,7 @@ func (n *actionsNotifier) NotifyCreateIssueComment(ctx context.Context, doer *us Sender: convert.ToUser(ctx, doer, nil), IsPull: true, }). + WithPullRequest(issue.PullRequest). Notify(ctx) return } |