Support annotated tags when using create release API

This adds a new field, "tag_message", that represents the message
of the annotated tag.
pull/31840/head
Kemal Zebari 3 months ago
parent b491b2104f
commit 6ec5cb77bd
  1. 1
      modules/structs/release.go
  2. 2
      routers/api/v1/repo/release.go
  3. 4
      templates/swagger/v1_json.tmpl

@ -33,6 +33,7 @@ type Release struct {
type CreateReleaseOption struct {
// required: true
TagName string `json:"tag_name" binding:"Required"`
TagMessage string `json:"tag_message"`
Target string `json:"target_commitish"`
Title string `json:"name"`
Note string `json:"body"`

@ -246,7 +246,7 @@ func CreateRelease(ctx *context.APIContext) {
IsTag: false,
Repo: ctx.Repo.Repository,
}
if err := release_service.CreateRelease(ctx.Repo.GitRepo, rel, nil, ""); err != nil {
if err := release_service.CreateRelease(ctx.Repo.GitRepo, rel, nil, form.TagMessage); err != nil {
if repo_model.IsErrReleaseAlreadyExist(err) {
ctx.Error(http.StatusConflict, "ReleaseAlreadyExist", err)
} else if models.IsErrProtectedTagName(err) {

@ -20115,6 +20115,10 @@
"type": "boolean",
"x-go-name": "IsPrerelease"
},
"tag_message": {
"type": "string",
"x-go-name": "TagMessage"
},
"tag_name": {
"type": "string",
"x-go-name": "TagName"

Loading…
Cancel
Save