From fe83aadef51bd5f62d1afd8c51f3eeb76c837d6b Mon Sep 17 00:00:00 2001 From: uy/sun Date: Mon, 2 Dec 2024 21:56:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=B5=81=E7=A8=8B=E4=B8=AD=E5=BF=98=E8=AE=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=87=E9=A2=98=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#308)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/plugins/github/plugins/config/__init__.py | 3 +++ tests/github/config/process/test_config_check.py | 12 ++++++++++++ 3 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index acebeb87..d5231e87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/ - 修复重新测试时没有提示测试进行中的问题 - 修复机器人修改议题等操作时仍会触发响应器的问题 +- 修复修改配置流程中忘记修改标题的问题 ## [4.1.1] - 2024-12-01 diff --git a/src/plugins/github/plugins/config/__init__.py b/src/plugins/github/plugins/config/__init__.py index 52400621..59521c19 100644 --- a/src/plugins/github/plugins/config/__init__.py +++ b/src/plugins/github/plugins/config/__init__.py @@ -96,6 +96,9 @@ async def handle_remove_check( # 限制标题长度,过长的标题不好看 title = f"{result.type}: {result.name[:TITLE_MAX_LENGTH]}" + # 修改议题标题 + await handler.update_issue_title(title) + if result.valid: commit_message = f"{COMMIT_MESSAGE_PREFIX} {result.type.value.lower()} {result.name} (#{handler.issue_number})" diff --git a/tests/github/config/process/test_config_check.py b/tests/github/config/process/test_config_check.py index ee86bafa..46e6e077 100644 --- a/tests/github/config/process/test_config_check.py +++ b/tests/github/config/process/test_config_check.py @@ -165,6 +165,18 @@ async def test_process_config_check( }, True, ) + ctx.should_call_api( + "rest.issues.async_update", + snapshot( + { + "owner": "he0119", + "repo": "action-test", + "issue_number": 80, + "title": "Plugin: name", + } + ), + None, + ) ctx.should_call_api( "rest.pulls.async_create", snapshot(