跳到正文
Skillpedia
部署与云(DevOps)28k · #9855

gh-fix-ci

它能做什么

这项技能使用 GitHub CLI 读取日志,调查 GitHub 拉取请求中失败的检查项。适合希望理解并修复构建失败、而不是靠猜测的开发者。

适用场景

  • ✓当拉取请求显示 GitHub Actions 检查失败,而你想知道原因的时候。
  • ✓当你想在决定如何修复之前,先看一份失败构建日志的摘要时。
  • ✓当你希望先起草修复方案,并且只有在你批准后才修改代码的时候。

技能链接

https://github.com/openai/skills/blob/main/skills/.curated/gh-fix-ci/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/openai/skills/blob/main/skills/.curated/gh-fix-ci/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我查一下我的 GitHub 拉取请求检查为什么失败,并在改动任何内容之前先给出修复建议。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会检查你的 GitHub 登录状态,找到拉取请求,读取失败的 GitHub Actions 任务日志,写出摘要和方案,然后等你批准后再编辑代码。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Gh Pr Checks Plan Fix

Overview

Use gh to locate failing PR checks, fetch GitHub Actions logs for actionable failures, summarize the failure snippet, then propose a fix plan and implement after explicit approval.

  • If a plan-oriented skill (for example create-plan) is available, use it; otherwise draft a concise plan inline and request approval before implementing.

Prereq: authenticate with the standard GitHub CLI once (for example, run gh auth login), then confirm with gh auth status (repo + workflow scopes are typically required).

Inputs

  • repo: path inside the repo (default .)
  • pr: PR number or URL (optional; defaults to current branch PR)
  • gh authentication for the repo host

Quick start

  • python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "<number-or-url>"
  • Add --json if you want machine-friendly output for summarization.

Workflow

  1. Verify gh authentication.
    • Run gh auth status in the repo.
    • If unauthenticated, ask the user to run gh auth login (ensuring repo + workflow scopes) before proceeding.
  2. Resolve the PR.
    • Prefer the current branch PR: gh pr view --json number,url.
    • If the user provides a PR number or URL, use that directly.
  3. Inspect failing checks (GitHub Actions only).
    • Preferred: run the bundled script (handles gh field drift and job-log fallbacks):
      • python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "<number-or-url>"
      • Add --json for machine-friendly output.
    • Manual fallback:
      • gh pr checks <pr> --json name,state,bucket,link,startedAt,completedAt,workflow
        • If a field is rejected, rerun with the available fields reported by gh.
      • For each failing check, extract the run id from detailsUrl and run:
        • gh run view <run_id> --json name,workflowName,conclusion,status,url,event,headBranch,headSha
        • gh run view <run_id> --log
      • If the run log says it is still in progress, fetch job logs directly:
        • gh api "/repos/<owner>/<repo>/actions/jobs/<job_id>/logs" > "<path>"
  4. Scope non-GitHub Actions checks.
    • If detailsUrl is not a GitHub Actions run, label it as external and only report the URL.
    • Do not attempt Buildkite or other providers; keep the workflow lean.
  5. Summarize failures for the user.
    • Provide the failing check name, run URL (if any), and a concise log snippet.
    • Call out missing logs explicitly.
  6. Create a plan.
    • Use the create-plan skill to draft a concise plan and request approval.
  7. Implement after approval.
    • Apply the approved plan, summarize diffs/tests, and ask about opening a PR.
  8. Recheck status.
    • After changes, suggest re-running the relevant tests and gh pr checks to confirm.

Bundled Resources

scripts/inspect_pr_checks.py

Fetch failing PR checks, pull GitHub Actions logs, and extract a failure snippet. Exits non-zero when failures remain so it can be used in automation.

Usage examples:

  • python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "123"
  • python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "https://github.com/org/repo/pull/123" --json
  • python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --max-lines 200 --context 40
常见问题

使用之前需要准备什么?

需要安装并登录 GitHub CLI,并且有该代码仓库的访问权限。

其他服务运行的检查怎么办?

该技能把 Buildkite 等外部服务商的检查视为超出范围,只报告其详情链接。

它会不经询问就修改我的代码吗?

不会。只有在你明确批准后,该技能才会实施修复。

详情

作者的原始描述

Use when a user asks to debug or fix failing GitHub PR checks that run in GitHub Actions; use `gh` to inspect checks and logs, summarize failure context, draft a fix plan, and implement only after explicit approval. Treat external providers (for example Buildkite) as out of scope and report only the details URL.

repo: openai/skills

热度

GitHub 星标
28k
排名
#9855
许可证
—
更新时间
2026/10/28

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能