PullRequest¶
-
class
github.PullRequest.
PullRequest
¶ This class represents PullRequests.
The reference can be found here https://docs.github.com/en/rest/reference/pulls
-
as_issue
() → github.Issue.Issue¶
-
create_comment
(body: str, commit: github.Commit.Commit, path: str, position: int) → github.PullRequestComment.PullRequestComment¶
-
create_review_comment
(body: str, commit: github.Commit.Commit, path: str, line: Union[int, github.GithubObject._NotSetType] = NotSet, side: Union[str, github.GithubObject._NotSetType] = NotSet, start_line: Union[int, github.GithubObject._NotSetType] = NotSet, start_side: Union[int, github.GithubObject._NotSetType] = NotSet, in_reply_to: Union[int, github.GithubObject._NotSetType] = NotSet, subject_type: Union[str, github.GithubObject._NotSetType] = NotSet, as_suggestion: bool = False) → github.PullRequestComment.PullRequestComment¶
-
create_review_comment_reply
(comment_id: int, body: str) → github.PullRequestComment.PullRequestComment¶
-
create_issue_comment
(body: str) → github.IssueComment.IssueComment¶
-
create_review
(commit: Opt[github.Commit.Commit] = NotSet, body: Opt[str] = NotSet, event: Opt[str] = NotSet, comments: Opt[list[ReviewComment]] = NotSet) → github.PullRequestReview.PullRequestReview¶
-
create_review_request
(reviewers: Opt[list[str] | str] = NotSet, team_reviewers: Opt[list[str] | str] = NotSet) → None¶
-
delete_review_request
(reviewers: Opt[list[str] | str] = NotSet, team_reviewers: Opt[list[str] | str] = NotSet) → None¶
-
edit
(title: Union[str, github.GithubObject._NotSetType] = NotSet, body: Union[str, github.GithubObject._NotSetType] = NotSet, state: Union[str, github.GithubObject._NotSetType] = NotSet, base: Union[str, github.GithubObject._NotSetType] = NotSet, maintainer_can_modify: Union[bool, github.GithubObject._NotSetType] = NotSet) → None¶
-
get_comment
(id: int) → github.PullRequestComment.PullRequestComment¶
-
get_review_comment
(id: int) → github.PullRequestComment.PullRequestComment¶
-
get_comments
(sort: Union[str, github.GithubObject._NotSetType] = NotSet, direction: Union[str, github.GithubObject._NotSetType] = NotSet, since: Union[datetime.datetime, github.GithubObject._NotSetType] = NotSet) → github.PaginatedList.PaginatedList[github.PullRequestComment.PullRequestComment][github.PullRequestComment.PullRequestComment]¶ Warning: this only returns review comments. For normal conversation comments, use get_issue_comments.
- Calls
- Parameters
sort – string ‘created’ or ‘updated’
direction – string ‘asc’ or ‘desc’
since – datetime
-
get_review_comments
(*, sort: Union[str, github.GithubObject._NotSetType] = NotSet, direction: Union[str, github.GithubObject._NotSetType] = NotSet, since: Union[datetime.datetime, github.GithubObject._NotSetType] = NotSet) → github.PaginatedList.PaginatedList[github.PullRequestComment.PullRequestComment][github.PullRequestComment.PullRequestComment]¶ - Calls
- Parameters
sort – string ‘created’ or ‘updated’
direction – string ‘asc’ or ‘desc’
since – datetime
-
get_single_review_comments
(id: int) → github.PaginatedList.PaginatedList[github.PullRequestComment.PullRequestComment][github.PullRequestComment.PullRequestComment]¶
-
get_commits
() → github.PaginatedList.PaginatedList[github.Commit.Commit][github.Commit.Commit]¶
-
get_files
() → github.PaginatedList.PaginatedList[github.File.File][github.File.File]¶
-
get_issue_comment
(id: int) → github.IssueComment.IssueComment¶
-
get_issue_comments
() → github.PaginatedList.PaginatedList[github.IssueComment.IssueComment][github.IssueComment.IssueComment]¶
-
get_issue_events
() → github.PaginatedList.PaginatedList[github.IssueEvent.IssueEvent][github.IssueEvent.IssueEvent]¶
-
get_review
(id: int) → github.PullRequestReview.PullRequestReview¶ - Calls
- Parameters
id – integer
- Return type
-
get_reviews
() → github.PaginatedList.PaginatedList[github.PullRequestReview.PullRequestReview][github.PullRequestReview.PullRequestReview]¶
-
get_review_requests
() → tuple[PaginatedList[NamedUser], PaginatedList[github.Team.Team]]¶ - Calls
GET /repos/{owner}/{repo}/pulls/{number}/requested_reviewers
- Return type
tuple of
github.PaginatedList.PaginatedList
ofgithub.NamedUser.NamedUser
and ofgithub.PaginatedList.PaginatedList
ofgithub.Team.Team
-
get_labels
() → github.PaginatedList.PaginatedList[github.Label.Label][github.Label.Label]¶
-
add_to_labels
(*labels: github.Label.Label | str) → None¶
-
delete_labels
() → None¶
-
remove_from_labels
(label: github.Label.Label | str) → None¶
-
set_labels
(*labels: github.Label.Label | str) → None¶
-
is_merged
() → bool¶
-
restore_branch
() → GitRef¶ Convenience function that calls
Repository.create_git_ref()
:rtype:github.GitRef.GitRef
-
delete_branch
(force: bool = False) → None¶ Convenience function that calls
GitRef.delete()
:rtype: bool.
-
enable_automerge
(merge_method: Opt[str] = 'MERGE', author_email: Opt[str] = NotSet, client_mutation_id: Opt[str] = NotSet, commit_body: Opt[str] = NotSet, commit_headline: Opt[str] = NotSet, expected_head_oid: Opt[str] = NotSet) → dict[str, Any]¶ - Calls
POST /graphql with a mutation to enable pull request auto merge
<https://docs.github.com/en/graphql/reference/mutations#enablepullrequestautomerge>
-
disable_automerge
(client_mutation_id: Opt[str] = NotSet) → dict[str, Any]¶ - Calls
POST /graphql with a mutation to disable pull request auto merge
<https://docs.github.com/en/graphql/reference/mutations#disablepullrequestautomerge>
-
merge
(commit_message: Union[str, github.GithubObject._NotSetType] = NotSet, commit_title: Union[str, github.GithubObject._NotSetType] = NotSet, merge_method: Union[str, github.GithubObject._NotSetType] = NotSet, sha: Union[str, github.GithubObject._NotSetType] = NotSet, delete_branch: bool = False) → github.PullRequestMergeStatus.PullRequestMergeStatus¶
-
add_to_assignees
(*assignees: github.NamedUser.NamedUser | str) → None¶
-
remove_from_assignees
(*assignees: github.NamedUser.NamedUser | str) → None¶
-
update_branch
(expected_head_sha: Union[str, github.GithubObject._NotSetType] = NotSet) → bool¶ :calls PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch
-