w-gha

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Fix failing GitHub Actions for the current branch. Use
gh
, never GitHub MCP for Actions logs. Follow git publish.
  1. git branch --show-current
    . Resolve the upstream tracking branch and confirm it exists.
    git status -sb
    is not proof the branch is pushed. Confirm HEAD is not ahead of upstream, or identify the PR head SHA (
    gh pr view --json headRefOid
    ) and use that SHA when selecting runs.
  2. gh pr checks
    ;
    gh run list --branch "$(git branch --show-current)" --limit 10
    (or
    --commit <headSha>
    ); failed run →
    gh run view <id> --log-failed
    ; artifacts →
    gh run download <id>
    .
  3. Parse logs for tests, lint, build, missing deps, env, timeouts. Change the owning cause.
  4. Re-run the same local commands the workflow uses. Do not add
    gh run watch
    to every push. No commit or push unless the user requested that action.
  5. Docs:
    /w-docs
    if behavior or commands changed.
修复当前分支中失败的 GitHub Actions。使用
gh
获取 Actions 日志,绝不要使用 GitHub MCP。按照 git publish 执行。
  1. git branch --show-current
    。确定上游跟踪分支并确认其存在。
    git status -sb
    不能证明分支已推送。确认 HEAD 未领先于上游,或识别 PR 头分支的 SHA(
    gh pr view --json headRefOid
    ),并在选择运行记录时使用该 SHA。
  2. gh pr checks
    ;
    gh run list --branch "$(git branch --show-current)" --limit 10
    (或使用
    --commit <headSha>
    );对于失败的运行,使用
    gh run view <id> --log-failed
    ;对于 artifacts,使用
    gh run download <id>
    。
  3. 解析日志中的测试、lint、build、依赖缺失、环境变量和超时等问题。修复导致失败的根因。
  4. 重新运行 workflow 使用的相同本地命令。不要在每次 push 时都添加
    gh run watch
    。除非用户明确要求,否则不要 commit 或 push。
  5. 文档:如果行为或命令发生变化,使用
    /w-docs
    。