使用GitHub REST API获取特定分支上的所有标签 [英] Get all tags on a specific branch using GitHub REST API

查看:114
本文介绍了使用GitHub REST API获取特定分支上的所有标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于 GitHub存储库API ,有一项操作可以列出a存储库,例如:

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?

推荐答案

没有可以直接执行此操作的API方法,但是您可以通过

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

,然后使用提交比较API 返回分支基础和分支头之间的提交列表(在响应的提交"部分)?

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?

这篇关于使用GitHub REST API获取特定分支上的所有标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆