Get all tags on a specific branch using GitHub REST API

ぃ、小莉子 提交于 2020-01-06 02:42:11

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!