Skip to main content

commit_pr_branches

Creates, updates, deletes, gets or lists a commit_pr_branches resource.

Overview

Namecommit_pr_branches
TypeResource
Idgithub.repos.commit_pr_branches

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger (int64)
node_idstring (example: MDExOlB1bGxSZXF1ZXN0MQ==)
_linksobject
active_lock_reasonstring (example: too heated)
assigneeobjectA GitHub user. (title: Simple User)
assigneesarray
author_associationstringHow the author is associated with the repository. (COLLABORATOR, CONTRIBUTOR, FIRST_TIMER, FIRST_TIME_CONTRIBUTOR, MANNEQUIN, MEMBER, NONE, OWNER) (title: author_association, example: OWNER)
auto_mergeobjectThe status of auto merging a pull request. (title: Auto merge)
baseobject
bodystring (example: Please pull these awesome changes)
closed_atstring (date-time) (example: 2011-01-26T19:01:12Z)
comments_urlstring (uri) (example: https://api.github.com/repos/octocat/Hello-World/issues/1347/comments)
commits_urlstring (uri) (example: https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits)
created_atstring (date-time) (example: 2011-01-26T19:01:12Z)
diff_urlstring (uri) (example: https://github.com/octocat/Hello-World/pull/1347.diff)
draftbooleanIndicates whether or not the pull request is a draft.
headobject
html_urlstring (uri) (example: https://github.com/octocat/Hello-World/pull/1347)
issue_urlstring (uri) (example: https://api.github.com/repos/octocat/Hello-World/issues/1347)
labelsarray
lockedboolean
merge_commit_shastring (example: e5bd3914e2e596debea16f433f57875b5b90bcd6)
merged_atstring (date-time) (example: 2011-01-26T19:01:12Z)
milestoneobjectA collection of related issues and pull requests. (title: Milestone)
numberinteger
patch_urlstring (uri) (example: https://github.com/octocat/Hello-World/pull/1347.patch)
requested_reviewersarray
requested_teamsarray
review_comment_urlstring (example: https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number})
review_comments_urlstring (uri) (example: https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments)
statestring (example: open)
statuses_urlstring (uri) (example: https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e)
titlestring (example: new-feature)
updated_atstring (date-time) (example: 2011-01-26T19:01:12Z)
urlstring (uri) (example: https://api.github.com/repos/octocat/Hello-World/pulls/1347)
userobjectA GitHub user. (title: Simple User)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_pull_requests_associated_with_commitselectowner, repo, commit_shaper_page, pageLists 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.

NameDatatypeDescription
commit_shastringThe SHA of the commit.
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.
pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

SELECT examples

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 }}'
;