问题
Looking to the GitHub repository API, there is one operation to list all branches of a repository, e.g.:
GET https://api.github.com/repos/telefonicaid/fiware-orion/branches
and also an operation to list all tags of a repository, e.g.:
GET https://api.github.com/repos/telefonicaid/fiware-orion/tags
However, I don't find in such documentation any way of getting all tags on an specific branch. Is there any way of doing that, please?
回答1:
There's no API method that will do this directly, but you could list all tags in the repository via
GET /repos/:owner/:repo/tags
and then use the commit compare API to return a list of commits (in the "commits" part of the response) between the branch base and branch head?
来源:https://stackoverflow.com/questions/37831029/get-all-tags-on-a-specific-branch-using-github-rest-api