mirror of
https://github.com/go-gitea/gitea
synced 2025-07-14 14:37:20 +00:00
Support annotated tags when using create release API (#31840)
This adds a new field, "tag_message", that represents the message of the annotated tag. Resolves #31835. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@ -247,7 +247,9 @@ func CreateRelease(ctx *context.APIContext) {
|
||||
IsTag: false,
|
||||
Repo: ctx.Repo.Repository,
|
||||
}
|
||||
if err := release_service.CreateRelease(ctx.Repo.GitRepo, rel, nil, ""); err != nil {
|
||||
// GitHub doesn't have "tag_message", GitLab has: https://docs.gitlab.com/api/releases/#create-a-release
|
||||
// It doesn't need to be the same as the "release note"
|
||||
if err := release_service.CreateRelease(ctx.Repo.GitRepo, rel, nil, form.TagMessage); err != nil {
|
||||
if repo_model.IsErrReleaseAlreadyExist(err) {
|
||||
ctx.APIError(http.StatusConflict, err)
|
||||
} else if release_service.IsErrProtectedTagName(err) {
|
||||
|
Reference in New Issue
Block a user