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回跑,属正常现象")