summaryrefslogtreecommitdiffstats
path: root/routers/web
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2023-01-25 05:47:53 +0100
committerGitHub <noreply@github.com>2023-01-24 23:47:53 -0500
commitc8139c0f642a308b544d2f17e7b728ee6762a0eb (patch)
tree0b29563e5a3fe8511e18a1eb6f2cfdf2453fc88a /routers/web
parenta31fedd2c2def13e29a962c751c449491d5a1588 (diff)
downloadgitea-c8139c0f642a308b544d2f17e7b728ee6762a0eb.tar.gz
gitea-c8139c0f642a308b544d2f17e7b728ee6762a0eb.zip
Webhooks: for issue close/reopen action, add commit ID that caused it (#22583)
The `commit_id` property name is the same as equivalent functionality in GitHub. If the action was not caused by a commit, an empty string is used. This can for example be used to automatically add a Resolved label to an issue fixed by a commit, or clear it when the issue is reopened.
Diffstat (limited to 'routers/web')
-rw-r--r--routers/web/repo/issue.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go
index 44ac81f65d..edd9821ac7 100644
--- a/routers/web/repo/issue.go
+++ b/routers/web/repo/issue.go
@@ -2599,7 +2599,7 @@ func UpdateIssueStatus(ctx *context.Context) {
}
for _, issue := range issues {
if issue.IsClosed != isClosed {
- if err := issue_service.ChangeStatus(issue, ctx.Doer, isClosed); err != nil {
+ if err := issue_service.ChangeStatus(issue, ctx.Doer, "", isClosed); err != nil {
if issues_model.IsErrDependenciesLeft(err) {
ctx.JSON(http.StatusPreconditionFailed, map[string]interface{}{
"error": "cannot close this issue because it still has open dependencies",
@@ -2696,7 +2696,7 @@ func NewComment(ctx *context.Context) {
ctx.Flash.Info(ctx.Tr("repo.pulls.open_unmerged_pull_exists", pr.Index))
} else {
isClosed := form.Status == "close"
- if err := issue_service.ChangeStatus(issue, ctx.Doer, isClosed); err != nil {
+ if err := issue_service.ChangeStatus(issue, ctx.Doer, "", isClosed); err != nil {
log.Error("ChangeStatus: %v", err)
if issues_model.IsErrDependenciesLeft(err) {