commits
Creates, updates, deletes, gets or lists a commits resource.
Overview
| Name | commits |
| Type | Resource |
| Id | github.pulls.commits |
Fields
The following fields are returned by SELECT queries:
- list_commits
Response
| Name | Datatype | Description |
|---|---|---|
node_id | string | (example: MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==) |
author | object | A GitHub user. (title: Simple User) |
comments_url | string (uri) | (example: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments) |
commit | object | |
committer | object | A GitHub user. (title: Simple User) |
files | array | |
html_url | string (uri) | (example: https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e) |
parents | array | |
sha | string | (example: 6dcb09b5b57875f334f61aebed695e2e4193db5e) |
stats | object | |
url | string (uri) | (example: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_commits | select | owner, repo, pull_number | per_page, page | Lists a maximum of 250 commits for a pull request. To receive a complete commit list for pull requests with more than 250 commits, use the List commits endpoint. This endpoint supports the following custom media types. For more information, see "Media types." - application/vnd.github.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.- application/vnd.github.text+json: Returns a text only representation of the markdown body. Response will include body_text.- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
owner | string | The account owner of the repository. The name is not case sensitive. |
pull_number | integer | The number that identifies the pull request. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
SELECT examples
- list_commits
Lists a maximum of 250 commits for a pull request. To receive a complete
commit list for pull requests with more than 250 commits, use the List commits
endpoint.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
- application/vnd.github.text+json: Returns a text only representation of the markdown body. Response will include body_text.
- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
SELECT
node_id,
author,
comments_url,
commit,
committer,
files,
html_url,
parents,
sha,
stats,
url
FROM github.pulls.commits
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND pull_number = '{{ pull_number }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;