Skip to content

Commit

Permalink
fix: 修改 Handler 里 create_pull_request 函数的参数
Browse files Browse the repository at this point in the history
  • Loading branch information
BigOrangeQWQ committed Nov 3, 2024
1 parent 4dd777e commit 19ab8ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/plugins/github/models/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ async def merge_pull_request(
logger.info(f"拉取请求 #{pull_number} 已合并")

async def get_pull_request_by_branch(self, branch_name: str) -> PullRequestSimple:
"""根据分支的名称获取对应的拉取请求示例"""
"""根据分支的名称获取对应的拉取请求实例"""
return (
await self.bot.rest.pulls.async_list(
**self.repo_info.model_dump(),
Expand Down Expand Up @@ -176,11 +176,9 @@ async def create_pull_request(
title: str,
branch_name: str,
label: str | list[str],
body: str | None,
body: str = "",
) -> int:
"""创建拉取请求并分配标签,若存在请求会导致 raise RequestFailed"""
if body is None:
body = ""

resp = await self.bot.rest.pulls.async_create(
**self.repo_info.model_dump(),
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/github/models/issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ async def create_pull_request(
title: str,
branch_name: str,
label: str | list[str],
body: str | None = None,
body: str = "",
):
if body is None:
if not body:
body = f"resolve #{self.issue_number}"

return await super().create_pull_request(
Expand Down

0 comments on commit 19ab8ed

Please sign in to comment.