commit_pr_branches
Creates, updates, deletes, gets or lists a commit_pr_branches resource.
Overview
| Name | commit_pr_branches |
| Type | Resource |
| Id | github.repos.commit_pr_branches |
Fields
The following fields are returned by SELECT queries:
- list_pull_requests_associated_with_commit
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | |
node_id | string | (example: MDExOlB1bGxSZXF1ZXN0MQ==) |
_links | object | |
active_lock_reason | string | (example: too heated) |
assignee | object | A GitHub user. (title: Simple User) |
assignees | array | |
author_association | string | How the author is associated with the repository. (COLLABORATOR, CONTRIBUTOR, FIRST_TIMER, FIRST_TIME_CONTRIBUTOR, MANNEQUIN, MEMBER, NONE, OWNER) (title: author_association, example: OWNER) |
auto_merge | object | The status of auto merging a pull request. (title: Auto merge) |
base | object | |
body | string | (example: Please pull these awesome changes) |
closed_at | string (date-time) | (example: 2011-01-26T19:01:12Z) |
comments_url | string (uri) | (example: https://api.github.com/repos/octocat/Hello-World/issues/1347/comments) |
commits_url | string (uri) | (example: https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits) |
created_at | string (date-time) | (example: 2011-01-26T19:01:12Z) |
diff_url | string (uri) | (example: https://github.com/octocat/Hello-World/pull/1347.diff) |
draft | boolean | Indicates whether or not the pull request is a draft. |
head | object | |
html_url | string (uri) | (example: https://github.com/octocat/Hello-World/pull/1347) |
issue_url | string (uri) | (example: https://api.github.com/repos/octocat/Hello-World/issues/1347) |
labels | array | |
locked | boolean | |
merge_commit_sha | string | (example: e5bd3914e2e596debea16f433f57875b5b90bcd6) |
merged_at | string (date-time) | (example: 2011-01-26T19:01:12Z) |
milestone | object | A collection of related issues and pull requests. (title: Milestone) |
number | integer | |
patch_url | string (uri) | (example: https://github.com/octocat/Hello-World/pull/1347.patch) |
requested_reviewers | array | |
requested_teams | array | |
review_comment_url | string | (example: https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}) |
review_comments_url | string (uri) | (example: https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments) |
state | string | (example: open) |
statuses_url | string (uri) | (example: https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e) |
title | string | (example: new-feature) |
updated_at | string (date-time) | (example: 2011-01-26T19:01:12Z) |
url | string (uri) | (example: https://api.github.com/repos/octocat/Hello-World/pulls/1347) |
user | object | A GitHub user. (title: Simple User) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_pull_requests_associated_with_commit | select | owner, repo, commit_sha | per_page, page | Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, it will return merged and open pull requests associated with the commit. To list the open or merged pull requests associated with a branch, you can set the commit_sha parameter to the branch name. |
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 |
|---|---|---|
commit_sha | string | The SHA of the commit. |
owner | string | The account owner of the repository. The name is not case sensitive. |
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_pull_requests_associated_with_commit
Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, it will return merged and open pull requests associated with the commit.
To list the open or merged pull requests associated with a branch, you can set the commit_sha parameter to the branch name.
SELECT
id,
node_id,
_links,
active_lock_reason,
assignee,
assignees,
author_association,
auto_merge,
base,
body,
closed_at,
comments_url,
commits_url,
created_at,
diff_url,
draft,
head,
html_url,
issue_url,
labels,
locked,
merge_commit_sha,
merged_at,
milestone,
number,
patch_url,
requested_reviewers,
requested_teams,
review_comment_url,
review_comments_url,
state,
statuses_url,
title,
updated_at,
url,
user
FROM github.repos.commit_pr_branches
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND commit_sha = '{{ commit_sha }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;