List commits on a pull request
GET
/repos/{owner}/{repo}/pulls/{pull_number}/commits
pulls
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://api.github.com/repos///pulls//commits'
响应示例响应示例
[
{
"author": {
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"gravatar_id": "41d064eb2195891e12d0413f63227ea7",
"html_url": "https://github.com/octocat",
"id": 1,
"login": "octocat",
"node_id": "MDQ6VXNlcjE=",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"repos_url": "https://api.github.com/users/octocat/repos",
"site_admin": true,
"starred_at": "\"2020-07-09T00:17:55Z\"",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"type": "User",
"url": "https://api.github.com/users/octocat"
},
"comments_url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments",
"commit": {
"author": {
"date": "\"2007-10-29T02:42:39.000-07:00\"",
"email": "\"chris@ozmm.org\"",
"name": "\"Chris Wanstrath\""
},
"comment_count": 0,
"committer": {
"date": "\"2007-10-29T02:42:39.000-07:00\"",
"email": "\"chris@ozmm.org\"",
"name": "\"Chris Wanstrath\""
},
"message": "Fix all the bugs",
"tree": {
"sha": "827efc6d56897b048c772eb4087f854f46256132",
"url": "https://api.github.com/repos/octocat/Hello-World/tree/827efc6d56897b048c772eb4087f854f46256132"
},
"url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
"verification": {
"payload": "string",
"reason": "string",
"signature": "string",
"verified": true
}
},
"committer": {
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"gravatar_id": "41d064eb2195891e12d0413f63227ea7",
"html_url": "https://github.com/octocat",
"id": 1,
"login": "octocat",
"node_id": "MDQ6VXNlcjE=",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"repos_url": "https://api.github.com/users/octocat/repos",
"site_admin": true,
"starred_at": "\"2020-07-09T00:17:55Z\"",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"type": "User",
"url": "https://api.github.com/users/octocat"
},
"files": [
{
"additions": 0,
"blob_url": "string",
"changes": 0,
"contents_url": "\"https://api.github.com/repos/owner-3d68404b07d25daeb2d4a6bf/AAA_Public_Repo/contents/geometry.js?ref=c3956841a7cb7e8ba4a6fd923568d86958f01573\"",
"deletions": 0,
"filename": "string",
"patch": "string",
"previous_filename": "\"subdir/before_name.txt\"",
"raw_url": "string",
"sha": "\"1e8e60ce9733d5283f7836fa602b6365a66b2567\"",
"status": "string"
}
],
"html_url": "https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e",
"node_id": "MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==",
"parents": [
{
"html_url": "https://github.com/octocat/Hello-World/commit/7638417db6d59f3c431d3e1f261cc637155684cd",
"sha": "7638417db6d59f3c431d3e1f261cc637155684cd",
"url": "https://api.github.com/repos/octocat/Hello-World/commits/7638417db6d59f3c431d3e1f261cc637155684cd"
}
],
"sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
"stats": {
"additions": 0,
"deletions": 0,
"total": 0
},
"url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e"
}
]
请求参数
Path 参数
owner
string
必需
repo
string
必需
pull_number
integer
必需
Query 参数
per_page
integer
可选
page
integer
可选