summaryrefslogtreecommitdiffstats
path: root/routers/api/v1
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/api/v1
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/api/v1')
-rw-r--r--routers/api/v1/repo/issue.go4
-rw-r--r--routers/api/v1/repo/pull.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go
index fecb601dd5..458838b935 100644
--- a/routers/api/v1/repo/issue.go
+++ b/routers/api/v1/repo/issue.go
@@ -654,7 +654,7 @@ func CreateIssue(ctx *context.APIContext) {
}
if form.Closed {
- if err := issue_service.ChangeStatus(issue, ctx.Doer, true); err != nil {
+ if err := issue_service.ChangeStatus(issue, ctx.Doer, "", true); err != nil {
if issues_model.IsErrDependenciesLeft(err) {
ctx.Error(http.StatusPreconditionFailed, "DependenciesLeft", "cannot close this issue because it still has open dependencies")
return
@@ -826,7 +826,7 @@ func EditIssue(ctx *context.APIContext) {
}
if statusChangeComment != nil {
- notification.NotifyIssueChangeStatus(ctx, ctx.Doer, issue, statusChangeComment, issue.IsClosed)
+ notification.NotifyIssueChangeStatus(ctx, ctx.Doer, "", issue, statusChangeComment, issue.IsClosed)
}
// Refetch from database to assign some automatic values
diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go
index 8fdbec4b89..8164b38694 100644
--- a/routers/api/v1/repo/pull.go
+++ b/routers/api/v1/repo/pull.go
@@ -600,7 +600,7 @@ func EditPullRequest(ctx *context.APIContext) {
}
if statusChangeComment != nil {
- notification.NotifyIssueChangeStatus(ctx, ctx.Doer, issue, statusChangeComment, issue.IsClosed)
+ notification.NotifyIssueChangeStatus(ctx, ctx.Doer, "", issue, statusChangeComment, issue.IsClosed)
}
// change pull target branch