Github API:查找未标记的提交

Github API: Finding untagged commits

是否可以使用 Github API 找到自最新版本以来所有未标记的提交?

首先,您可以获得latest release with the GitHub API(匹配matest标签)

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

这意味着您可以 compare two commits:

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

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

备注:

  1. 参见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. 这假设您的发布是在 master 分支上完成的(但您 can create a release on another branch