Github API: Finding untagged commits

帅比萌擦擦* 提交于 2019-12-23 02:42:27

问题


Is it possible to find all untagged commits since the latest release using Github API?


回答1:


First, you can get the latest release with the GitHub API (which matches the matest tag)

GET /repos/:owner/:repo/releases/latest

That means you can then compare two commits:

GET /repos/:owner/:repo/compare/:base...:head

For example: https://api.github.com/repos/git-for-windows/git/compare/v2.4.5.windows.1...master

Notes:

  1. See Working with large comparisons:

    The response will include a comparison of up to 250 commits.
    If you are working with a larger commit range, you can use the Commit List API to enumerate all commits in the range.

  2. This assume your release was done on the master branch (but you can create a release on another branch)



来源:https://stackoverflow.com/questions/31632900/github-api-finding-untagged-commits

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