Skip to content

Commit

Permalink
fix: 修复拉取请求标签没有打上的问题 (#106)
Browse files Browse the repository at this point in the history
需要等创建完拉取请求并打上标签后修改议题标题,不然会因为修改议题触发 Actions 导致标签没有正常打上
  • Loading branch information
he0119 committed Feb 9, 2023
1 parent d1bcbfe commit be23a20
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/
- rc3 默认不自带 fastapi,修改为 none 驱动
- 修复插件测试中创建项目失败时,没有正确判断的问题
- 修复 Actions 排队后未能正确跳过关闭的议题的问题
- 修复拉取请求标签没有打上的问题

### Changed

Expand Down
14 changes: 8 additions & 6 deletions src/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,6 @@ def process_publish_check(
if isinstance(info, PublishInfo):
# 拉取请求与议题的标题
title = f"{info.get_type().value}: {info.name}"
# 修改议题标题
if issue.title != title:
self.github.rest.issues.update(
self.owner, self.name, issue.number, title=title
)
logging.info(f"议题标题已修改为 {title}")
# 创建新分支
# 命名示例 publish/issue123
branch_name = f"{BRANCH_NAME_PREFIX}{issue.number}"
Expand All @@ -157,6 +151,14 @@ def process_publish_check(
commit_and_push(info, branch_name, issue.number)
# 创建拉取请求
self.create_pull_request(info, branch_name, issue.number, title)
# 修改议题标题
# 需要等创建完拉取请求并打上标签后执行
# 不然会因为修改议题触发 Actions 导致标签没有正常打上
if issue.title != title:
self.github.rest.issues.update(
self.owner, self.name, issue.number, title=title
)
logging.info(f"议题标题已修改为 {title}")
message = info.validation_message
else:
message = info.message
Expand Down

0 comments on commit be23a20

Please sign in to comment.