使用 GitHub API 跟踪提交
Tracking commits with the GitHub API
我希望使用 GitHub API,但我无法在文档中找到我需要的内容。
有两件事我找不到。
- 我看到我可以 list all the commits in a repository, but I'm not sure how to get each commit's details without calling the single commit endpoint 很多次。
具体来说,每个文件中 changes
的数量。
- 我似乎无法弄清楚的另一件事是,每当在存储库上进行提交时,我如何才能将 webhook/event 发送到我的应用程序。我已经到达 webhooks page,但似乎找不到我要找的活动。
我需要的是可能的吗?还是我只是遗漏了文档中的某些内容?
您无法通过 API 获得 diff for each commits in one go。
你可以得到一个 global diff between arbitrary commits with an URL, or, through the API, comparing two commits,其中 returns 一个差异 URL。但这不会跟踪每个中间提交差异。
关于 webhook,您想要的事件是 push event:它将由推送到您的存储库的任何新提交触发。
我希望使用 GitHub API,但我无法在文档中找到我需要的内容。
有两件事我找不到。
- 我看到我可以 list all the commits in a repository, but I'm not sure how to get each commit's details without calling the single commit endpoint 很多次。
具体来说,每个文件中changes
的数量。 - 我似乎无法弄清楚的另一件事是,每当在存储库上进行提交时,我如何才能将 webhook/event 发送到我的应用程序。我已经到达 webhooks page,但似乎找不到我要找的活动。
我需要的是可能的吗?还是我只是遗漏了文档中的某些内容?
您无法通过 API 获得 diff for each commits in one go。
你可以得到一个 global diff between arbitrary commits with an URL, or, through the API, comparing two commits,其中 returns 一个差异 URL。但这不会跟踪每个中间提交差异。
关于 webhook,您想要的事件是 push event:它将由推送到您的存储库的任何新提交触发。