본문으로 건너뛰기
cccskills
무료GitHub에 공개

gh-fix-ci

Inspect failing GitHub Actions checks on PRs, fetch detailed logs, summarize failures, create a fix plan, and implement fixes after user approval. For external CI systems, report details only.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구GitHub
설치 방법 보기

포함된 파일(2)

  • SKILL.md6.5 KB
  • scripts/inspect_pr_checks.py14.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

GitHub PR Checks Fix

Use This Skill When

  • GitHub Actions checks failing on your PR
  • Need to understand why CI/CD workflow failed
  • Want actionable fix plan for failing tests/builds
  • Debugging workflow configuration issues
  • Fixing flaky tests or environment problems
  • Non-GitHub Actions checks: report details URL only (out of scope)

When NOT to Use

  • External CI systems (Buildkite, CircleCI, Travis)
  • Complex approval workflows requiring multiple stakeholders
  • Workflow failures in protected branches (needs admin)
  • Local debugging (local testing more efficient)

Context: CI Debugging Maturity

Undeveloped: Click through GitHub UI, read raw logs, guess at fixes.

Target: Fetch logs via CLI, summarize failure, draft plan, implement after approval.

Optimized: Predict root causes, suggest preventive measures, auto-retry flaky tests, integrated remediation.

Core Principle

Failed CI should be actionable. Fetch logs programmatically, surface the actual failure context (not noise), create a concrete plan, and let the developer decide how to fix.

Instructions

Step 1: Verify gh CLI Authentication

Check auth status:

gh auth status

If not authenticated:

gh auth login
# Select GitHub.com, HTTPS or SSH
# Authorize with scopes: repo, workflow

Verify elevated permissions:

gh auth refresh --scopes repo,workflow

Step 2: Resolve the PR

Find current branch's PR:

gh pr view --json number,url,title

Or specify PR explicitly:

gh pr view 123  # PR number
# or
gh pr view https://github.com/owner/repo/pull/123  # Full URL

Step 3: Inspect Failing Checks

List all checks on PR:

gh pr checks [PR] --json name,state,conclusion,url,detailsUrl

Filter for failures:

gh pr checks [PR] --json name,state,conclusion,url,detailsUrl | \
  jq '.[] | select(.conclusion == "FAILURE" or .state == "FAILURE")'

Step 4: Fetch Detailed Failure Logs

For GitHub Actions failures:

# Get run details
gh run view [RUN_ID] --json name,workflowName,conclusion,status,url,event,headBranch

# Fetch full logs
gh run view [RUN_ID] --log > failure_logs.txt

# Or fetch specific job logs
gh api "/repos/OWNER/REPO/actions/jobs/JOB_ID/logs" > job_logs.txt

For non-GitHub Actions (external):

❌ External CI detected: [System Name]
📋 Details URL: [Link]
⏭️ Out of scope for this skill
👉 Visit the link above to debug manually

Step 5: Summarize Failure Context

Extract key failure snippet:

## Failed Check Summary

**Check Name**: tests-ubuntu
**Status**: ❌ FAILURE
**Run ID**: [RUN_ID]
**URL**: [GitHub Actions Run URL]

### Error Context

**Last 30 lines of output:**

[STDERR snippet from logs showing actual failure]


**Likely Root Cause**: 
- Test assertion failed: `expect(result).toBe(true)`
- Expected: true
- Received: false

**Context**:
- Test file: `src/utils.test.ts`
- Test name: "parseConfig returns valid structure"
- Failure appears consistent (not flaky)

**Next Steps**: Needs investigation of config parsing logic

Step 6: Create Fix Plan

Use plan skill to draft:

# Plan: Fix Test Failure in tests-ubuntu

We need to debug why `parseConfig()` is returning false instead of true.

## Scope

**In:**
- Review parseConfig logic in src/utils.ts
- Check test expectations in src/utils.test.ts
- Verify mock data/fixtures

**Out:**
- Refactoring entire config system
- Upgrading testing framework

## Action Items

- [ ] Run test locally: `npm test -- src/utils.test.ts`
- [ ] Add console.log to see actual parseConfig output
- [ ] Compare expected vs. actual config structure
- [ ] Fix parseConfig or update test expectations
- [ ] Verify test passes locally
- [ ] Push changes and verify CI passes

## Open Questions

- Is the test expectation correct?
- Did a recent code change break parseConfig?

Step 7: Implement After User Approval

After user approves plan:

  1. Make code changes

    # Edit files based on plan
    code src/utils.ts  # Fix the logic
    code src/utils.test.ts  # Or update test expectations
    
  2. Test locally

    npm test -- src/utils.test.ts
    # Or the specific test
    npm test -- src/utils.test.ts -t "parseConfig returns valid"
    
  3. Commit changes

    git add src/
    git commit -m "Fix parseConfig test failure — ensure config validation works correctly"
    git push
    
  4. Verify CI recheck

    # GitHub Actions auto-triggers on push
    # Or manually re-run:
    gh run rerun [RUN_ID]
    
    # Monitor status
    gh pr checks [PR]
    

Step 8: Re-check Status

After changes, verify fixes:

gh pr checks [PR] --json state,conclusion

If still failing:

  • Fetch new logs
  • Repeat analysis
  • Consider flaky test vs. actual issue

If passing:

✅ All checks passing!
Ready to merge or request review.

Common Failure Patterns

PatternIndicatorFix
Timeout"execution timeout after 300s"Increase timeout or optimize code
Missing dep"Cannot find module 'x'"Add missing package or import
Flaky test"Intermittent failures"Add retry, improve timing, mock randomness
Env var missing"process.env.API_KEY undefined"Add secret to Actions workflow
Type error"Property 'x' does not exist on type 'y'"Fix TypeScript type annotations
Permission denied"Access denied to /path"Fix file permissions or paths

Troubleshooting

IssueSolution
Can't fetch logsVerify gh auth with gh auth refresh --scopes repo,workflow
Run ID not foundUse gh pr checks [PR] to get correct run ID
External CI systemReport details URL only; out of scope
Still can't debugTry running test locally first to narrow scope

Output

Deliver:

  1. Failure Summary with logs excerpt
  2. Likely Root Cause (educated guess from logs)
  3. Fix Plan (using plan skill)
  4. After approval: Applied changes with commit link
  5. Re-check results (passing or still failing)

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

manu14357/zskills162026년 7월 24일 업데이트

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

manu14357/zskills162026년 7월 24일 업데이트

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

manu14357/zskills162026년 7월 24일 업데이트

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

manu14357/zskills162026년 7월 24일 업데이트

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

manu14357/zskills162026년 7월 24일 업데이트

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

manu14357/zskills162026년 7월 24일 업데이트

manu14357의 스킬 모두 보기

이 스킬의 문제 신고