Add tag protection manage via rest API. --------- Co-authored-by: Alexander Kogay <kogay.a@citilink.ru> Co-authored-by: Giteabot <teabot@gitea.io> (cherry picked from commit d4e4226c3cbfa62a6adf15f4466747468eb208c7) Conflicts: modules/structs/repo_tag.go trivial context conflict templates/swagger/v1_json.tmpl fixed with make generate-swagger
This commit is contained in:
parent
7fa7ec0891
commit
ff43d02803
8 changed files with 778 additions and 0 deletions
|
@ -1112,6 +1112,15 @@ func Routes() *web.Route {
|
|||
m.Post("", reqToken(), reqRepoWriter(unit.TypeCode), mustNotBeArchived, bind(api.CreateTagOption{}), repo.CreateTag)
|
||||
m.Delete("/*", reqToken(), reqRepoWriter(unit.TypeCode), mustNotBeArchived, repo.DeleteTag)
|
||||
}, reqRepoReader(unit.TypeCode), context.ReferencesGitRepo(true))
|
||||
m.Group("/tag_protections", func() {
|
||||
m.Combo("").Get(repo.ListTagProtection).
|
||||
Post(bind(api.CreateTagProtectionOption{}), mustNotBeArchived, repo.CreateTagProtection)
|
||||
m.Group("/{id}", func() {
|
||||
m.Combo("").Get(repo.GetTagProtection).
|
||||
Patch(bind(api.EditTagProtectionOption{}), mustNotBeArchived, repo.EditTagProtection).
|
||||
Delete(repo.DeleteTagProtection)
|
||||
})
|
||||
}, reqToken(), reqAdmin())
|
||||
m.Group("/actions", func() {
|
||||
m.Get("/tasks", repo.ListActionTasks)
|
||||
}, reqRepoReader(unit.TypeActions), context.ReferencesGitRepo(true))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue