From 4ee4f993eedc8067150644f9c054b28349122d87 Mon Sep 17 00:00:00 2001 From: Gusted Date: Fri, 15 Jul 2022 16:48:10 +0200 Subject: [PATCH] Set target on create release with existing tag - 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. --- routers/api/v1/repo/release.go | 1 + 1 file changed, 1 insertion(+) diff --git a/routers/api/v1/repo/release.go b/routers/api/v1/repo/release.go index 8dfe7e06d26f8..80009f78e99c0 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)