aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2022-07-15 18:39:03 +0000
committerGitHub <noreply@github.com>2022-07-15 20:39:03 +0200
commit57e0bf43eb3d93933aac351958599b6623ddf978 (patch)
tree42a6fc7b94f5381e8676e860c6c54d4fdf1b8399 /routers/api
parentdbd3b7f9fd367ffabc89706e19af85713f0e0e11 (diff)
downloadgitea-57e0bf43eb3d93933aac351958599b6623ddf978.tar.gz
gitea-57e0bf43eb3d93933aac351958599b6623ddf978.zip
Set target on create release with existing tag (#20381)
When you create a new release(e.g. via Tea) and specify a tag that already exists on the repository, Gitea will instead use the `UpdateRelease` functionality. However it currently doesn't set the Target field. This PR fixes that.
Diffstat (limited to 'routers/api')
-rw-r--r--routers/api/v1/repo/release.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/routers/api/v1/repo/release.go b/routers/api/v1/repo/release.go
index 8dfe7e06d2..80009f78e9 100644
--- a/routers/api/v1/repo/release.go
+++ b/routers/api/v1/repo/release.go
@@ -224,6 +224,7 @@ func CreateRelease(ctx *context.APIContext) {
rel.IsTag = false
rel.Repo = ctx.Repo.Repository
rel.Publisher = ctx.Doer
+ rel.Target = form.Target
if err = release_service.UpdateRelease(ctx.Doer, ctx.Repo.GitRepo, rel, nil, nil, nil); err != nil {
ctx.Error(http.StatusInternalServerError, "UpdateRelease", err)