fix(repair-agent): add git push after auto-commit
All checks were successful
Build and Deploy Log Center / build-and-deploy (push) Successful in 2m46s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
zyc 2026-02-24 13:17:16 +08:00
parent d58ca4b131
commit aa3a5b8c5d

View File

@ -204,11 +204,13 @@ class RepairEngine:
modified_files=modified_files, diff=diff, modified_files=modified_files, diff=diff,
)) ))
# 自动提交(仅在 Git 启用时) # 自动提交并推送(仅在 Git 启用时)
if git_enabled and auto_commit and modified_files and git_manager: if git_enabled and auto_commit and modified_files and git_manager:
bug_ids = ", ".join([f"#{b.id}" for b in bugs]) bug_ids = ", ".join([f"#{b.id}" for b in bugs])
git_manager.commit(f"fix: auto repair bugs {bug_ids}") git_manager.commit(f"fix: auto repair bugs {bug_ids}")
logger.info("代码已提交") logger.info("代码已提交")
git_manager.push()
logger.info("代码已推送到远程")
elif not git_enabled and auto_commit: elif not git_enabled and auto_commit:
logger.info("未配置 GitHub 仓库,跳过自动提交") logger.info("未配置 GitHub 仓库,跳过自动提交")