Add tag protection manage via rest API. --------- Co-authored-by: Alexander Kogay <kogay.a@citilink.ru> Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
parent
4e7b067a7f
commit
d4e4226c3c
8 changed files with 778 additions and 0 deletions
|
@ -1168,6 +1168,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