Skip to content

Commit

Permalink
Fix: Update PullRequest model for auto_merge property
Browse files Browse the repository at this point in the history
The auto_merge property of a pull request is an object too and contains
information about the merge method.
  • Loading branch information
bjoernricks committed Feb 3, 2023
1 parent b2918bb commit 6684c51
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pontos/github/models/pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
__all__ = (
"AuthorAssociation",
"FileStatus",
"MergeMethod",
"MilestoneState",
"PullRequest",
"PullRequestCommit",
Expand Down Expand Up @@ -180,6 +181,20 @@ class AuthorAssociation(Enum):
OWNER = "OWNER"


class MergeMethod(Enum):
MERGE = "merge"
SQUASH = "squash"
REBASE = "rebase"


@dataclass
class AutoMerge(GitHubModel):
enabled_by: User
merge_method: MergeMethod
commit_title: str
commit_message: str


@dataclass
class PullRequest(GitHubModel):
additions: int
Expand Down Expand Up @@ -216,7 +231,7 @@ class PullRequest(GitHubModel):
active_lock_reason: Optional[str] = None
assignee: Optional[User] = None
assignees: List[User] = field(default_factory=list)
auto_merge: Optional[bool] = None
auto_merge: Optional[AutoMerge] = None
body: Optional[str] = None
closed_at: Optional[datetime] = None
draft: Optional[bool] = None
Expand Down

0 comments on commit 6684c51

Please sign in to comment.