fix: 错误分类 changelog (#10887)

This commit is contained in:
uye
2024-10-23 19:40:47 +08:00
committed by GitHub
parent 1aec5d7013
commit bfd488b2f6

View File

@@ -103,10 +103,18 @@ def individual_commits(commits: dict, indent: str = "") -> Tuple[str, list]:
def update_commits(commit_message, sorted_commits, update_dict):
oper = "other"
for key, trans in translations.items():
if commit_message.startswith(trans.value) or key in commit_message:
# 优先检查 commit_message 中是否有明确的前缀
for trans in Translation:
if commit_message.startswith(trans.value):
oper = trans.value
break
else:
# 如果没有明确前缀,则检查翻译的中文关键词
for key, trans in translations.items():
if key in commit_message:
oper = trans.value
break
sorted_commits[oper].update(update_dict)