From be196cc2ccbcc93c0e20c4827ea1817a0111571f Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Tue, 28 Jul 2026 08:19:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=98=B2=E5=BE=AA=E7=8E=AF=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E5=8F=96=E6=9C=80=E6=96=B0commit=EF=BC=88API=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=80=92=E5=BA=8F=EF=BC=8C=E7=94=A8[0]=E8=80=8C?= =?UTF-8?q?=E9=9D=9E[-1]=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/ci/auto_fix_formatting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci/auto_fix_formatting.py b/scripts/ci/auto_fix_formatting.py index 1d927af58..bc32c5308 100755 --- a/scripts/ci/auto_fix_formatting.py +++ b/scripts/ci/auto_fix_formatting.py @@ -258,7 +258,7 @@ def main(): req_commits = urllib.request.Request(commits_url, headers={"Authorization": f"token {token}"}) with urllib.request.urlopen(req_commits) as resp_commits: commits = json.loads(resp_commits.read()) - latest_msg = commits[-1].get("commit", {}).get("message", "") if commits else "" + latest_msg = commits[0].get("commit", {}).get("message", "") if commits else "" if skip_marker in latest_msg: print(f"检测到最新commit包含 {skip_marker} 标记,跳过格式修复(防循环)") print("本次格式检查失败是格式修复commit触发的CI回跑,属正常现象")