Конечные точки REST API для комментариев проверка запроса на вытягивание
Используйте REST API для взаимодействия с проверка запроса на вытягивание комментариями.
О комментариях проверка запроса на вытягивание
Примечания проверки запроса на вытягивание — это комментарии к части единого диффа во время проверка запроса на вытягивание. Это отличается от комментариев фиксации и примечаний в запросе на вытягивание. Дополнительные сведения см. в разделе "[AUTOTITLE" и "Конечные точки REST API для комментариев фиксации](/rest/issues/comments)".
List review comments in a repository
Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID.
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github-commitcomment.raw+json
: Returns the raw markdown body. Response will includebody
. This is the default if you do not pass any specific media type.application/vnd.github-commitcomment.text+json
: Returns a text only representation of the markdown body. Response will includebody_text
.application/vnd.github-commitcomment.html+json
: Returns HTML rendered from the body's markdown. Response will includebody_html
.application/vnd.github-commitcomment.full+json
: Returns raw, text, and HTML representations. Response will includebody
,body_text
, andbody_html
.
Подробные маркеры доступа для "List review comments in a repository
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Маркер с точной детализацией должен иметь следующий набор разрешений.:
- "Pull requests" repository permissions (read)
Эту конечную точку можно использовать без проверки подлинности или указанных выше разрешений, если запрашиваются только общедоступные ресурсы.
Параметры для "List review comments in a repository"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
owner string Обязательное полеThe account owner of the repository. The name is not case sensitive. |
repo string Обязательное полеThe name of the repository without the |
Имя., Тип, Description |
---|
sort string Возможные значения: |
direction string The direction to sort results. Ignored without Возможные значения: |
since string Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: |
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." По умолчанию.: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." По умолчанию.: |
Коды состояния http-ответа для "List review comments in a repository"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "List review comments in a repository"
Пример запроса
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/pulls/comments
Response
Status: 200
[
{
"url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1",
"pull_request_review_id": 42,
"id": 10,
"node_id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw",
"diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
"path": "file1.txt",
"position": 1,
"original_position": 4,
"commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
"original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
"in_reply_to_id": 8,
"user": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://HOSTNAME/users/octocat/followers",
"following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
"gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
"organizations_url": "https://HOSTNAME/users/octocat/orgs",
"repos_url": "https://HOSTNAME/users/octocat/repos",
"events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"body": "Great stuff!",
"created_at": "2011-04-14T16:00:49Z",
"updated_at": "2011-04-14T16:00:49Z",
"html_url": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1",
"pull_request_url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1",
"author_association": "NONE",
"_links": {
"self": {
"href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1"
},
"html": {
"href": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1"
},
"pull_request": {
"href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1"
}
},
"start_line": 1,
"original_start_line": 1,
"start_side": "RIGHT",
"line": 2,
"original_line": 2,
"side": "RIGHT"
}
]
Get a review comment for a pull request
Provides details for a specified review comment.
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github-commitcomment.raw+json
: Returns the raw markdown body. Response will includebody
. This is the default if you do not pass any specific media type.application/vnd.github-commitcomment.text+json
: Returns a text only representation of the markdown body. Response will includebody_text
.application/vnd.github-commitcomment.html+json
: Returns HTML rendered from the body's markdown. Response will includebody_html
.application/vnd.github-commitcomment.full+json
: Returns raw, text, and HTML representations. Response will includebody
,body_text
, andbody_html
.
Подробные маркеры доступа для "Get a review comment for a pull request
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Маркер с точной детализацией должен иметь следующий набор разрешений.:
- "Pull requests" repository permissions (read)
Эту конечную точку можно использовать без проверки подлинности или указанных выше разрешений, если запрашиваются только общедоступные ресурсы.
Параметры для "Get a review comment for a pull request"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
owner string Обязательное полеThe account owner of the repository. The name is not case sensitive. |
repo string Обязательное полеThe name of the repository without the |
comment_id integer Обязательное полеThe unique identifier of the comment. |
Коды состояния http-ответа для "Get a review comment for a pull request"
Код состояния | Описание |
---|---|
200 | OK |
404 | Resource not found |
Примеры кода для "Get a review comment for a pull request"
Пример запроса
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/pulls/comments/COMMENT_ID
Response
Status: 200
{
"url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1",
"pull_request_review_id": 42,
"id": 10,
"node_id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw",
"diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
"path": "file1.txt",
"position": 1,
"original_position": 4,
"commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
"original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
"in_reply_to_id": 8,
"user": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://HOSTNAME/users/octocat/followers",
"following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
"gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
"organizations_url": "https://HOSTNAME/users/octocat/orgs",
"repos_url": "https://HOSTNAME/users/octocat/repos",
"events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"body": "Great stuff!",
"created_at": "2011-04-14T16:00:49Z",
"updated_at": "2011-04-14T16:00:49Z",
"html_url": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1",
"pull_request_url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1",
"author_association": "NONE",
"_links": {
"self": {
"href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1"
},
"html": {
"href": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1"
},
"pull_request": {
"href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1"
}
},
"start_line": 1,
"original_start_line": 1,
"start_side": "RIGHT",
"line": 2,
"original_line": 2,
"side": "RIGHT"
}
Update a review comment for a pull request
Edits the content of a specified review comment.
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github-commitcomment.raw+json
: Returns the raw markdown body. Response will includebody
. This is the default if you do not pass any specific media type.application/vnd.github-commitcomment.text+json
: Returns a text only representation of the markdown body. Response will includebody_text
.application/vnd.github-commitcomment.html+json
: Returns HTML rendered from the body's markdown. Response will includebody_html
.application/vnd.github-commitcomment.full+json
: Returns raw, text, and HTML representations. Response will includebody
,body_text
, andbody_html
.
Подробные маркеры доступа для "Update a review comment for a pull request
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Маркер с точной детализацией должен иметь следующий набор разрешений.:
- "Pull requests" repository permissions (write)
Параметры для "Update a review comment for a pull request"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
owner string Обязательное полеThe account owner of the repository. The name is not case sensitive. |
repo string Обязательное полеThe name of the repository without the |
comment_id integer Обязательное полеThe unique identifier of the comment. |
Имя., Тип, Description |
---|
body string Обязательное полеThe text of the reply to the review comment. |
Коды состояния http-ответа для "Update a review comment for a pull request"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "Update a review comment for a pull request"
Пример запроса
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/pulls/comments/COMMENT_ID \
-d '{"body":"I like this too!"}'
Response
Status: 200
{
"url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1",
"pull_request_review_id": 42,
"id": 10,
"node_id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw",
"diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
"path": "file1.txt",
"position": 1,
"original_position": 4,
"commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
"original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
"in_reply_to_id": 8,
"user": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://HOSTNAME/users/octocat/followers",
"following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
"gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
"organizations_url": "https://HOSTNAME/users/octocat/orgs",
"repos_url": "https://HOSTNAME/users/octocat/repos",
"events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"body": "Great stuff!",
"created_at": "2011-04-14T16:00:49Z",
"updated_at": "2011-04-14T16:00:49Z",
"html_url": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1",
"pull_request_url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1",
"author_association": "NONE",
"_links": {
"self": {
"href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1"
},
"html": {
"href": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1"
},
"pull_request": {
"href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1"
}
},
"start_line": 1,
"original_start_line": 1,
"start_side": "RIGHT",
"line": 2,
"original_line": 2,
"side": "RIGHT"
}
Delete a review comment for a pull request
Deletes a review comment.
Подробные маркеры доступа для "Delete a review comment for a pull request
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Маркер с точной детализацией должен иметь следующий набор разрешений.:
- "Pull requests" repository permissions (write)
Параметры для "Delete a review comment for a pull request"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
owner string Обязательное полеThe account owner of the repository. The name is not case sensitive. |
repo string Обязательное полеThe name of the repository without the |
comment_id integer Обязательное полеThe unique identifier of the comment. |
Коды состояния http-ответа для "Delete a review comment for a pull request"
Код состояния | Описание |
---|---|
204 | No Content |
404 | Resource not found |
Примеры кода для "Delete a review comment for a pull request"
Пример запроса
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/pulls/comments/COMMENT_ID
Response
Status: 204
List review comments on a pull request
Lists all review comments for a specified pull request. By default, review comments are in ascending order by ID.
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github-commitcomment.raw+json
: Returns the raw markdown body. Response will includebody
. This is the default if you do not pass any specific media type.application/vnd.github-commitcomment.text+json
: Returns a text only representation of the markdown body. Response will includebody_text
.application/vnd.github-commitcomment.html+json
: Returns HTML rendered from the body's markdown. Response will includebody_html
.application/vnd.github-commitcomment.full+json
: Returns raw, text, and HTML representations. Response will includebody
,body_text
, andbody_html
.
Подробные маркеры доступа для "List review comments on a pull request
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Маркер с точной детализацией должен иметь следующий набор разрешений.:
- "Pull requests" repository permissions (read)
Эту конечную точку можно использовать без проверки подлинности или указанных выше разрешений, если запрашиваются только общедоступные ресурсы.
Параметры для "List review comments on a pull request"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
owner string Обязательное полеThe account owner of the repository. The name is not case sensitive. |
repo string Обязательное полеThe name of the repository without the |
pull_number integer Обязательное полеThe number that identifies the pull request. |
Имя., Тип, Description |
---|
sort string The property to sort the results by. По умолчанию.: Возможные значения: |
direction string The direction to sort results. Ignored without Возможные значения: |
since string Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: |
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." По умолчанию.: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." По умолчанию.: |
Коды состояния http-ответа для "List review comments on a pull request"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "List review comments on a pull request"
Пример запроса
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/pulls/PULL_NUMBER/comments
Response
Status: 200
[
{
"url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1",
"pull_request_review_id": 42,
"id": 10,
"node_id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw",
"diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
"path": "file1.txt",
"position": 1,
"original_position": 4,
"commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
"original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
"in_reply_to_id": 8,
"user": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://HOSTNAME/users/octocat/followers",
"following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
"gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
"organizations_url": "https://HOSTNAME/users/octocat/orgs",
"repos_url": "https://HOSTNAME/users/octocat/repos",
"events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"body": "Great stuff!",
"created_at": "2011-04-14T16:00:49Z",
"updated_at": "2011-04-14T16:00:49Z",
"html_url": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1",
"pull_request_url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1",
"author_association": "NONE",
"_links": {
"self": {
"href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1"
},
"html": {
"href": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1"
},
"pull_request": {
"href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1"
}
},
"start_line": 1,
"original_start_line": 1,
"start_side": "RIGHT",
"line": 2,
"original_line": 2,
"side": "RIGHT"
}
]
Create a review comment for a pull request
Creates a review comment on the diff of a specified pull request. To add a regular comment to a pull request timeline, see "Create an issue comment."
If your comment applies to more than one line in the pull request diff, you should use the parameters line
, side
, and optionally start_line
and start_side
in your request.
The position
parameter is closing down. If you use position
, the line
, side
, start_line
, and start_side
parameters are not required.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "Rate limits for the API" and "Best practices for using the REST API."
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github-commitcomment.raw+json
: Returns the raw markdown body. Response will includebody
. This is the default if you do not pass any specific media type.application/vnd.github-commitcomment.text+json
: Returns a text only representation of the markdown body. Response will includebody_text
.application/vnd.github-commitcomment.html+json
: Returns HTML rendered from the body's markdown. Response will includebody_html
.application/vnd.github-commitcomment.full+json
: Returns raw, text, and HTML representations. Response will includebody
,body_text
, andbody_html
.
Подробные маркеры доступа для "Create a review comment for a pull request
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Маркер с точной детализацией должен иметь следующий набор разрешений.:
- "Pull requests" repository permissions (write)
Параметры для "Create a review comment for a pull request"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
owner string Обязательное полеThe account owner of the repository. The name is not case sensitive. |
repo string Обязательное полеThe name of the repository without the |
pull_number integer Обязательное полеThe number that identifies the pull request. |
Имя., Тип, Description |
---|
body string Обязательное полеThe text of the review comment. |
commit_id string Обязательное полеThe SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the |
path string Обязательное полеThe relative path to the file that necessitates a comment. |
position integer This parameter is closing down. Use |
side string In a split diff view, the side of the diff that the pull request's changes appear on. Can be Возможные значения: |
line integer Required unless using |
start_line integer Required when using multi-line comments unless using |
start_side string Required when using multi-line comments unless using Возможные значения: |
in_reply_to integer The ID of the review comment to reply to. To find the ID of a review comment with "List review comments on a pull request". When specified, all parameters other than |
subject_type string The level at which the comment is targeted. Возможные значения: |
Коды состояния http-ответа для "Create a review comment for a pull request"
Код состояния | Описание |
---|---|
201 | Created |
403 | Forbidden |
422 | Validation failed, or the endpoint has been spammed. |
Примеры кода для "Create a review comment for a pull request"
Пример запроса
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/pulls/PULL_NUMBER/comments \
-d '{"body":"Great stuff!","commit_id":"6dcb09b5b57875f334f61aebed695e2e4193db5e","path":"file1.txt","start_line":1,"start_side":"RIGHT","line":2,"side":"RIGHT"}'
Response
Status: 201
{
"url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1",
"pull_request_review_id": 42,
"id": 10,
"node_id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw",
"diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
"path": "file1.txt",
"position": 1,
"original_position": 4,
"commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
"original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
"in_reply_to_id": 8,
"user": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://HOSTNAME/users/octocat/followers",
"following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
"gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
"organizations_url": "https://HOSTNAME/users/octocat/orgs",
"repos_url": "https://HOSTNAME/users/octocat/repos",
"events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"body": "Great stuff!",
"created_at": "2011-04-14T16:00:49Z",
"updated_at": "2011-04-14T16:00:49Z",
"html_url": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1",
"pull_request_url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1",
"author_association": "NONE",
"_links": {
"self": {
"href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1"
},
"html": {
"href": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1"
},
"pull_request": {
"href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1"
}
},
"start_line": 1,
"original_start_line": 1,
"start_side": "RIGHT",
"line": 2,
"original_line": 2,
"side": "RIGHT"
}
Create a reply for a review comment
Creates a reply to a review comment for a pull request. For the comment_id
, provide the ID of the review comment you are replying to. This must be the ID of a top-level review comment, not a reply to that comment. Replies to replies are not supported.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "Rate limits for the API" and "Best practices for using the REST API."
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github-commitcomment.raw+json
: Returns the raw markdown body. Response will includebody
. This is the default if you do not pass any specific media type.application/vnd.github-commitcomment.text+json
: Returns a text only representation of the markdown body. Response will includebody_text
.application/vnd.github-commitcomment.html+json
: Returns HTML rendered from the body's markdown. Response will includebody_html
.application/vnd.github-commitcomment.full+json
: Returns raw, text, and HTML representations. Response will includebody
,body_text
, andbody_html
.
Подробные маркеры доступа для "Create a reply for a review comment
Эта конечная точка работает со следующими точными типами маркеров:
- Маркеры доступа пользователей приложения GitHub
- Маркеры доступа к установке приложений GitHub
- Точные личные маркеры доступа
Маркер с точной детализацией должен иметь следующий набор разрешений.:
- "Pull requests" repository permissions (write)
Параметры для "Create a reply for a review comment"
Имя., Тип, Description |
---|
accept string Setting to |
Имя., Тип, Description |
---|
owner string Обязательное полеThe account owner of the repository. The name is not case sensitive. |
repo string Обязательное полеThe name of the repository without the |
pull_number integer Обязательное полеThe number that identifies the pull request. |
comment_id integer Обязательное полеThe unique identifier of the comment. |
Имя., Тип, Description |
---|
body string Обязательное полеThe text of the review comment. |
Коды состояния http-ответа для "Create a reply for a review comment"
Код состояния | Описание |
---|---|
201 | Created |
404 | Resource not found |
Примеры кода для "Create a reply for a review comment"
Пример запроса
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/pulls/PULL_NUMBER/comments/COMMENT_ID/replies \
-d '{"body":"Great stuff!"}'
Response
Status: 201
{
"url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1",
"pull_request_review_id": 42,
"id": 10,
"node_id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw",
"diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
"path": "file1.txt",
"position": 1,
"original_position": 4,
"commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
"original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
"in_reply_to_id": 426899381,
"user": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://HOSTNAME/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://HOSTNAME/users/octocat/followers",
"following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
"gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
"starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
"organizations_url": "https://HOSTNAME/users/octocat/orgs",
"repos_url": "https://HOSTNAME/users/octocat/repos",
"events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
"received_events_url": "https://HOSTNAME/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"body": "Great stuff!",
"created_at": "2011-04-14T16:00:49Z",
"updated_at": "2011-04-14T16:00:49Z",
"html_url": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1",
"pull_request_url": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1",
"author_association": "NONE",
"_links": {
"self": {
"href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/comments/1"
},
"html": {
"href": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1"
},
"pull_request": {
"href": "https://HOSTNAME/repos/octocat/Hello-World/pulls/1"
}
},
"start_line": 1,
"original_start_line": 1,
"start_side": "RIGHT",
"line": 2,
"original_line": 2,
"side": "RIGHT"
}