Skip to content

Commit

Permalink
improve: 审查通过后如果可合并则直接合并 (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 authored Apr 8, 2023
1 parent 724f307 commit b4bce43
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/
### Changed

- 设置时区为中国
- 审查通过后如果可合并则直接合并

## [2.0.0] - 2023-04-07

Expand Down
13 changes: 9 additions & 4 deletions src/plugins/publish/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,15 @@ async def auto_merge(
**repo_info.dict(), pull_number=event.payload.pull_request.number
)
).parsed_data
# 需要先获取远程分支,否则无法切换到对应分支
run_shell_command(["git", "fetch", "origin", plugin_config.input_config.base])
# 直接尝试处理冲突,如果没有变化则不会提交
await resolve_conflict_pull_requests(bot, repo_info, [pull_request])

if not pull_request.mergeable:
# 需要先获取远程分支,否则无法切换到对应分支
run_shell_command(
["git", "fetch", "origin", plugin_config.input_config.base]
)
# 尝试处理冲突
await resolve_conflict_pull_requests(bot, repo_info, [pull_request])

await bot.rest.pulls.async_merge(
**repo_info.dict(),
pull_number=event.payload.pull_request.number,
Expand Down

0 comments on commit b4bce43

Please sign in to comment.