fix(ci): auto-fix checkout加--force + black格式对齐
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 18s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m25s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Successful in 3m46s
AI Code Review / AI Code Review (pull_request) Successful in 4m38s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 6m22s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 6m31s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 6m58s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 6m59s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 3m23s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 7s

This commit is contained in:
CI Bot
2026-07-20 13:16:54 +08:00
parent 3772b13c81
commit 970e640c15
+6 -3
View File
@@ -61,7 +61,8 @@ def ensure_git_repo(api_url, repo, token, pr_number):
# 强制checkout到源分支(覆盖tarball内容)
# tarball是merge后的commit,源分支才是我们要修改并推送的目标
print("切换到源分支...")
run(f"git checkout -B {head_branch} FETCH_HEAD")
# --force 覆盖tarball留下的untracked文件,避免"The following untracked working tree files would be overwritten"
run(f"git checkout -B --force {head_branch} FETCH_HEAD")
result = run("git status --porcelain")
if result.stdout.strip():
@@ -265,12 +266,14 @@ def main():
print(f"推送失败: {push_result.stderr[-200:]}", file=sys.stderr)
if attempt < max_push_retries:
import time
time.sleep(2 ** attempt)
time.sleep(2**attempt)
except Exception as e:
print(f"推送异常: {e}", file=sys.stderr)
if attempt < max_push_retries:
import time
time.sleep(2 ** attempt)
time.sleep(2**attempt)
if not push_success:
print("⚠️ 自动格式化推送失败,跳过(请手动检查)", file=sys.stderr)