API: Get release by tags endpoint (#12932)

Get a release based on a tag name (for which a release exists).
Based on:
https://developer.github.com/v3/repos/releases/#get-a-release-by-tag-name

Co-authored-by: 赵智超 <1012112796@qq.com>
Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
Johan Van de Wauw
2020-09-25 21:11:43 +02:00
committed by GitHub
parent d71eaacbf2
commit 34d9cb335c
4 changed files with 140 additions and 0 deletions

View File

@ -797,6 +797,9 @@ func RegisterRoutes(m *macaron.Macaron) {
Delete(reqToken(), reqRepoWriter(models.UnitTypeReleases), repo.DeleteReleaseAttachment)
})
})
m.Group("/tags", func() {
m.Get("/:tag", repo.GetReleaseTag)
})
}, reqRepoReader(models.UnitTypeReleases))
m.Post("/mirror-sync", reqToken(), reqRepoWriter(models.UnitTypeCode), repo.MirrorSync)
m.Get("/editorconfig/:filename", context.RepoRef(), reqRepoReader(models.UnitTypeCode), repo.GetEditorconfig)