fix(ci): 格式修复防循环索引 + AI审查fail-open(2个bug修复) #1045

Merged
xiaoxia merged 4 commits from fix/auto-fix-loop-detection into main 2026-07-28 09:52:23 +08:00
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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回跑,属正常现象")
+2 -2
View File
@@ -715,7 +715,7 @@ def main():
if not review_result:
logger.error("LLM 审查失败")
sys.exit(1)
sys.exit(0) # fail-open: LLM调用失败不阻塞合并
# 7. 加上审查时间和标识(便于识别是自动审查)
from datetime import datetime
@@ -773,7 +773,7 @@ def main():
except Exception as e:
logger.exception(f"审查脚本发生未预期的异常: {e}")
sys.exit(1)
sys.exit(0) # fail-open: 异常不阻塞正常开发
if __name__ == "__main__":