See the official GitHub API v2 documentation for pull requests.
Pull request container.
New in version 0.5.0.
The URL to the unified diff.
The text of the pull request title.
The base repo
The user who created the pull request.
Discussion thread for the pull request.
The date the issue for this pull request was last updated.
The date when this pull request was last updated.
A list of labels attached to the pull request.
Whether the pull request can be merge cleanly
Floating point position of the pull request.
Number of votes for this request.
Number of this request.
The date when this pull request was created.
The date when this pull request was closed
Number of comments made on this request.
The owner of the repo.
The date the issue for this pull request was opened.
The URL to the downloadable patch.
The pull request state
The text of the body.
The URL to the pull request.
The head of the pull request
GitHub API pull request functionality.
New in version 0.5.0.
Create a new pull request.
Pull requests can be created from scratch, or attached to an existing issue. If an issue parameter is supplied the pull request is attached to that issue, else a new pull request is created.
Parameters: |
---|
>>> results = github.pull_requests.list("ask/python-github2")
By default the first page of results is returned, you can return further results with the page parameter:
>>> results = github.pull_requests.list("ask/python-github2", page=2)
>>> request = github.pull_requests.show("ask/python-github2", 28)
>>> pull.body
'This implements the github API pull requests functionality. '
To open a new pull request against the ask/python-github2 project:
>>> pull = github.pull_requests.create("ask/python-github2", "master",
... "JNRowe:my_new_branch",
... title="Fancy features")
>>> pull.number
4
This creates a pull request for changes in JNRowe‘s my_new_branch and asks for it to be merged to ask‘s master branch.
To attach code to an existing issue and make it a pull request:
>>> pull = github.pull_requests.create("ask/python-github2", "master",
... "JNRowe:my_new_branch",
... issue=4)
Note
You can use any tree-ish for the head argument, you are not restricted to symbolic references.