Skip to content

Commit

Permalink
fix: 修复函数执行顺序
Browse files Browse the repository at this point in the history
  • Loading branch information
BigOrangeQWQ committed Sep 2, 2024
1 parent 9ea1728 commit aba04a2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/plugins/publish/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,12 @@ async def handle_publish_plugin_check(
# 修改议题标题
# 需要等创建完拉取请求并打上标签后执行
# 不然会因为修改议题触发 Actions 导致标签没有正常打上
await ensure_issue_test_button(bot, repo_info, issue_number, issue.body or "")
if issue.title != title:
await bot.rest.issues.async_update(
**repo_info.model_dump(), issue_number=issue_number, title=title
)
logger.info(f"议题标题已修改为 {title}")
await ensure_issue_test_button(bot, repo_info, issue_number, issue.body or "")
await comment_issue(bot, repo_info, issue_number, result)


Expand Down
2 changes: 1 addition & 1 deletion src/plugins/publish/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
PLUGIN_CONFIG_PATTERN = re.compile(r"### 插件配置项\s+```(?:\w+)?\s?([\s\S]*?)```")
PLUGIN_TEST_STRING = "插件测试"
PLUGIN_TEST_BUTTON_STRING = "- [x] 单击左侧按钮重新测试,完成时勾选框将被选中"
PLUGIN_TEST_BUTTON_PATTERN = re.compile(r"- \[(.)\] 单击左侧按钮重新测试")
PLUGIN_TEST_BUTTON_PATTERN = re.compile(r"- \[([ |x])\] 单击左侧按钮重新测试")
PLUGIN_SUPPORTED_ADAPTERS_STRING = "插件支持的适配器"
PLUGIN_SUPPORTED_ADAPTERS_PATTERN = re.compile(
ISSUE_PATTERN.format(PLUGIN_SUPPORTED_ADAPTERS_STRING)
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/publish/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,8 @@ async def ensure_issue_test_button(
body=f"{issue_body}\n\n{new_content}",
)
logger.info("为议题添加插件测试按钮。")
else:
logger.info("议题内容中已包含插件测试按钮。")


async def should_skip_plugin_publish(
Expand Down

0 comments on commit aba04a2

Please sign in to comment.