mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-03 03:55:58 +01:00
Call addedComment hook(send notification) at PR merged.
This commit is contained in:
@@ -251,7 +251,7 @@ trait PullRequestsControllerBase extends ControllerBase {
|
|||||||
using(Git.open(getRepositoryDir(owner, name))) { git =>
|
using(Git.open(getRepositoryDir(owner, name))) { git =>
|
||||||
// mark issue as merged and close.
|
// mark issue as merged and close.
|
||||||
val loginAccount = context.loginAccount.get
|
val loginAccount = context.loginAccount.get
|
||||||
createComment(owner, name, loginAccount.userName, issueId, form.message, "merge")
|
val commentId = createComment(owner, name, loginAccount.userName, issueId, form.message, "merge")
|
||||||
createComment(owner, name, loginAccount.userName, issueId, "Close", "close")
|
createComment(owner, name, loginAccount.userName, issueId, "Close", "close")
|
||||||
updateClosed(owner, name, issueId, true)
|
updateClosed(owner, name, issueId, true)
|
||||||
|
|
||||||
@@ -282,7 +282,10 @@ trait PullRequestsControllerBase extends ControllerBase {
|
|||||||
callPullRequestWebHook("closed", repository, issueId, context.baseUrl, context.loginAccount.get)
|
callPullRequestWebHook("closed", repository, issueId, context.baseUrl, context.loginAccount.get)
|
||||||
|
|
||||||
// call hooks
|
// call hooks
|
||||||
PluginRegistry().getPullRequestHooks.foreach(_.merged(issue, repository))
|
PluginRegistry().getPullRequestHooks.foreach{ h =>
|
||||||
|
h.addedComment(commentId, form.message, issue, repository)
|
||||||
|
h.merged(issue, repository)
|
||||||
|
}
|
||||||
|
|
||||||
redirect(s"/${owner}/${name}/pull/${issueId}")
|
redirect(s"/${owner}/${name}/pull/${issueId}")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user