PENDING
state do not include the submitted_at
property in the response.application/vnd.github.v3.diff
media type. To see a pull request diff, add this media type to the Accept
header of a call to the single pull request endpoint.position
value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file.curl --location --request POST 'https://api.github.com/repos///pulls//reviews' \
--header 'Content-Type: application/json' \
--data-raw '{
"body": "This is close to perfect! Please address the suggested inline change.",
"comments": [
{
"body": "Please add more information here, and fix this typo.",
"path": "file.md",
"position": 6
}
],
"commit_id": "ecdd80bb57125d7ba9641ffaa4d7d2c19d3f3091",
"event": "REQUEST_CHANGES"
}'
{
"_links": {
"html": {
"href": "string"
},
"pull_request": {
"href": "string"
}
},
"author_association": "OWNER",
"body": "This looks great.",
"body_html": "string",
"body_text": "string",
"commit_id": "54bb654c9e6025347f57900a4a5c2313a96b8035",
"html_url": "https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80",
"id": 42,
"node_id": "MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=",
"pull_request_url": "https://api.github.com/repos/octocat/Hello-World/pulls/12",
"state": "CHANGES_REQUESTED",
"submitted_at": "2019-08-24T14:15:22Z",
"user": {
"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"
}
}
Authorization: Bearer ********************
REQUEST_CHANGES
or COMMENT
for the event
parameter. The body text of the pull request review.position
. Defaults to the most recent commit in the pull request when you do not specify a value.APPROVE
, REQUEST_CHANGES
, or COMMENT
. By leaving this blank, you set the review action state to PENDING
, which means you will need to submit the pull request review when you are ready.【GitHub】API开发者 微信交流群
用微信扫右侧二维码,加入【GitHub】API开发者 交流群,互助沟通