Skip to main content

pull_request

Overview

Namepull_request
TypeResource
Idgithub.pulls.pull_request

Fields

NameDatatypeDescription
idinteger
_linksobject
active_lock_reasonstring
additionsinteger
assigneeobjectA GitHub user.
assigneesarray
author_associationstringHow the author is associated with the repository.
auto_mergeobjectThe status of auto merging a pull request.
baseobject
bodystring
changed_filesinteger
closed_atstring
commentsinteger
comments_urlstring
commitsinteger
commits_urlstring
created_atstring
deletionsinteger
diff_urlstring
draftbooleanIndicates whether or not the pull request is a draft.
headobject
html_urlstring
issue_urlstring
labelsarray
lockedboolean
maintainer_can_modifybooleanIndicates whether maintainers can modify the pull request.
merge_commit_shastring
mergeableboolean
mergeable_statestring
mergedboolean
merged_atstring
merged_byobjectA GitHub user.
milestoneobjectA collection of related issues and pull requests.
node_idstring
numberintegerNumber uniquely identifying the pull request within its repository.
patch_urlstring
rebaseableboolean
requested_reviewersarray
requested_teamsarray
review_comment_urlstring
review_commentsinteger
review_comments_urlstring
statestringState of this Pull Request. Either open or closed.
statuses_urlstring
titlestringThe title of the pull request.
updated_atstring
urlstring
userobjectA GitHub user.

Methods

NameAccessible byRequired ParamsDescription
getSELECTowner, pull_number, repoDraft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.

Lists details of a pull request by providing its number.

When you get, create, or edit a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the mergeable key. For more information, see "Checking mergeability of pull requests".

The value of the mergeable attribute can be true, false, or null. If the value is null, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-null value for the mergeable attribute in the response. If mergeable is true, then merge_commit_sha will be the SHA of the test merge commit.

The value of the merge_commit_sha attribute changes depending on the state of the pull request. Before merging a pull request, the merge_commit_sha attribute holds the SHA of the test merge commit. After merging a pull request, the merge_commit_sha attribute changes depending on how you merged the pull request:

If merged as a merge commit, merge_commit_sha represents the SHA of the merge commit.
If merged via a squash, merge_commit_sha represents the SHA of the squashed commit on the base branch.
* If rebased, merge_commit_sha represents the commit that the base branch was updated to.

Pass the appropriate media type to fetch diff and patch formats.
createINSERTowner, repo, data__base, data__headDraft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.

To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.

This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See "Secondary rate limits" and "Dealing with secondary rate limits" for details.
check_if_mergedEXECowner, pull_number, repoChecks if a pull request has been merged into the base branch. The HTTP status of the response indicates whether or not the pull request has been merged; the response body is empty.
mergeEXECowner, pull_number, repoMerges a pull request into the base branch.
This endpoint triggers notifications. Creating content too quickly using this endpoint may result in secondary rate limiting. See "Secondary rate limits" and "Dealing with secondary rate limits" for details.
updateEXECowner, pull_number, repoDraft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.

To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.
update_branchEXECowner, pull_number, repoUpdates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch.