Community研究與資料分析github.com

GitHub PR 檢查修復計畫

檢查 GitHub PR 的檢查狀態,提取失敗的 GitHub Actions 日誌,總結失敗原因,在使用者核准後建立修復計畫並實作。

GitHub PR 檢查修復計畫 是什麼?

此技能可自動化偵測與修復 GitHub PR 中失敗的 CI/CD 檢查。它使用 `gh` CLI 工具驗證身份驗證、取得 PR 號碼、檢查以提取失敗的 GitHub Actions 工作流程,並擷取相關日誌片段。然後,它總結失敗情境,並利用「計畫」技能起草修復計畫,等待使用者核准後再實作程式碼變更。對於 Buildkite 等外部檢查,它僅報告其 URL 並將其標記為超出範圍,以保持工作流程精簡。支援任何平台,只要使用者已透過 `gh auth login` 驗證並授予工作流程/儲存庫範圍授權即可。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComposioHQ/awesome-codex-skills/tree/main/gh-fix-ci

Installed? Explore more 研究與資料分析 skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Gh Pr 檢查修復計畫

概述

使用 gh 找出失敗的 PR 檢查、擷取可操作的 GitHub Actions 日誌、總結失敗片段,然後在使用者明確核准後提出修復計畫並實作。

  • 依賴於 plan 技能來草擬和核准修復計畫。

先決條件:確保 gh 已通過驗證(例如,執行 gh auth login 一次),然後以提升的權限(包括 workflow/repo 範圍)執行 gh auth status,以便 gh 命令成功執行。如果沙箱阻止 gh auth status,請使用 sandbox_permissions=require_escalated 重新執行。

輸入

  • repo:儲存庫內的路徑(預設為 .)
  • pr:PR 編號或 URL(可選;預設為目前分支的 PR)
  • gh 對儲存庫主機的身份驗證

快速開始

  • python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "<number-or-url>"
  • 如果需要機器可讀的輸出以進行摘要,請加上 --json。

工作流程

  1. 驗證 gh 身份驗證。
    • 在儲存庫中以提升的範圍(workflow/repo)執行 gh auth status,並在執行 gh auth login 之後執行。
    • 如果沙箱中的身份驗證狀態失敗,請使用 sandbox_permissions=require_escalated 重新執行命令,以允許網路/鑰匙圈存取。
    • 如果未通過驗證,請要求使用者先登入再繼續。
  2. 解析 PR。
    • 優先使用目前分支的 PR:gh pr view --json number,url。
    • 如果使用者提供了 PR 編號或 URL,則直接使用該值。
  3. 檢查失敗的檢查(僅限 GitHub Actions)。
    • 首選:執行捆綁腳本(處理 gh 欄位漂移和任務日誌回退):
      • python "<path-to-skill>/scripts/inspect_pr_checks.py" --repo "." --pr "<number-or-url>"
      • 加上 --json 以獲得機器可读的輸出。
    • 手動回退:
      • gh pr checks <pr> --json name,state,bucket,link,startedAt,completedAt,workflow
        • 如果某個欄位被拒絕,請使用 gh 報告的可用欄位重新執行。
      • 對於每個失敗的檢查,從 detailsUrl 中提取執行 ID 並執行:
        • gh run view <run_id> --json name,workflowName,conclusion,status,url,event,headBranch,headSha
        • gh run view <run_id> --log
      • 如果執行日誌顯示仍在進行中,請直接獲取任務日誌:
        • gh api "/repos/<owner>/<repo>/actions/jobs/<job_id>/logs" > "<path>"
  4. 限定非 GitHub Actions 檢查的範圍。
    • 如果 detailsUrl 不是 GitHub Actions 執行,則將其標記為外部並僅報告 URL。
    • 不要嘗試 Buildkite 或其他提供者;保持工作流程精簡。
  5. 向使用者總結失敗。
    • 提供失敗的檢查名稱、執行 URL(如果有)和簡潔的日誌片段。
    • 明確指出缺少的日誌。
  6. 建立計畫。
    • 使用 plan 技能草擬簡潔的計畫並請求核准。
  7. 核准後實作。
    • 套用已核准的計畫,總結差異/測試,並詢問是否要開啟 PR。
  8. 重新檢查狀態。
    • 在變更後,建議重新執行相關測試和 gh pr checks 以確認。

捆綁資源

scripts/inspect_pr_checks.py

擷取失敗的 PR 檢查、提取 GitHub Actions 日誌並提取失敗片段。當仍有失敗時會以非零狀態碼退出,因此可用於自動化。

使用範例:

  • 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

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComposioHQ/-21risk-automation

Automate 21risk tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/-2chat-automation

Automate 2chat tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/ably-automation

Automate Ably tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/abstract-automation

Automate Abstract tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/abuselpdb-automation

Automate Abuselpdb tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/abyssale-automation

Automate Abyssale tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/accelo-automation

Automate Accelo tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/accredible-certificates-automation

Automate Accredible Certificates tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/acculynx-automation

Automate Acculynx tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/active-campaign-automation

Automate ActiveCampaign tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/addresszen-automation

Automate Addresszen tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/adobe-automation

Automate Adobe tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/adrapid-automation

Automate Adrapid tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/adyntel-automation

Automate Adyntel tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/aeroleads-automation

Automate Aeroleads tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/aero-workflow-automation

Automate Aero Workflow tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/affinda-automation

Automate Affinda tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/affinity-automation

Automate Affinity tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/agencyzoom-automation

Automate Agencyzoom tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/agent-deep-links

Build, validate, and troubleshoot deep links for Codex, Cursor, VS Code, Visual Studio, and similar tools. Use when users ask for clickable links (especially in Slack) that open threads, files, folders, or app settings.

相關技能