loop-on-ci

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Loop on CI

循环处理CI任务

Trigger

触发条件

Need to watch branch CI and iterate on failures until green.
需要监控分支CI,针对失败项反复调试直至全部通过。

Workflow

工作流程

  1. Find the current branch and latest workflow run.
  2. Wait for CI completion with
    gh run watch --exit-status
    .
  3. If failed, inspect failed logs, implement a focused fix, commit, and push.
  4. Repeat until all required checks pass.
  1. 找到当前分支和最新的工作流运行记录。
  2. 使用
    gh run watch --exit-status
    等待CI完成。
  3. 如果失败,检查失败日志,针对性修复代码,提交并推送。
  4. 重复上述步骤直至所有必要检查通过。

Commands

命令

bash
undefined
bash
undefined

Latest run for current branch

当前分支的最新运行记录

gh run list --branch "$(git branch --show-current)" --limit 5
gh run list --branch "$(git branch --show-current)" --limit 5

Block until completion (0 on pass, non-zero on fail)

阻塞等待完成(通过返回0,失败返回非0)

gh run watch --exit-status
gh run watch --exit-status

Inspect failed jobs

检查失败的任务

gh run view <run-id> --log-failed
undefined
gh run view <run-id> --log-failed
undefined

Guardrails

防护措施

  • Keep each fix scoped to a single failure cause when possible.
  • Do not bypass hooks (
    --no-verify
    ) to force progress.
  • If failures are flaky, retry once and report flake evidence.
  • 尽可能让每个修复只针对单一失败原因。
  • 不要绕过钩子(
    --no-verify
    )来强行推进。
  • 如果是偶发失败,重试一次并提交偶发失败的证据。

Output

输出

  • Current CI status
  • Failure summary and fixes applied
  • PR URL once checks are green
  • 当前CI状态
  • 失败总结及已应用的修复
  • 检查通过后的PR链接