AgentSkillsCN

github-actions-debug

调试 GitHub Actions CI/CD 工作流的失败运行。适用于用户请求修复 CI、排查失败的工作流、查明构建失败的原因、深入探究 GitHub Actions 错误,或对流水线故障进行故障排除时使用。

SKILL.md
--- frontmatter
name: github-actions-debug
description: Debug failed GitHub Actions CI/CD workflow runs. Use when user asks to fix CI, debug a failed workflow, check why a build failed, investigate GitHub Actions errors, or troubleshoot pipeline failures.

GitHub Actions Debug — Phoenix Agentic Engine Interface

Repo Context

  • Owner: rivie13
  • Repo: Phoenix-Agentic-Engine-Interface
  • Type: Public (TS SDK + Contracts)

Workflows in this repo

Workflow filePurpose
ci.ymlTypecheck (tsc) + Test (vitest) on push/PR to main

CI Pipeline Details

The ci.yml workflow runs:

  1. Checkout code
  2. Setup Node.js 20 with npm cache
  3. Install dependencies: npm ci
  4. Typecheck: npm run typecheck
  5. Test: npm test

Debugging Workflow: Step-by-step

Step 1: List recent workflow runs

code
mcp_github_github_actions_list(owner="rivie13", repo="Phoenix-Agentic-Engine-Interface")

Step 2: Get details of a specific run

code
mcp_github_github_actions_get(owner="rivie13", repo="Phoenix-Agentic-Engine-Interface", run_id=<RUN_ID>)

Step 3: Get job logs for the failed job

code
mcp_github_github_get_job_logs(owner="rivie13", repo="Phoenix-Agentic-Engine-Interface", job_id=<JOB_ID>)

Step 4: Analyze the failure

Common failure patterns:

Failure typeTypical causeFix
TypeScript errorType mismatch, missing type annotationsRun npm run typecheck locally
Vitest failureTest assertion error, fixture driftRun npm test locally
Contract fixture mismatchFixture JSON doesn't match Zod schemaSync fixtures with backend golden tests
npm ci failureLock file out of syncRun npm install and commit package-lock.json
any type flaggedStrict mode violationReplace any with proper types

Step 5: Fix locally and verify

  1. Read the error from the job logs
  2. Run locally:
    • npm run typecheck — reproduce type errors
    • npm test — reproduce test failures
  3. Make the fix
  4. Run both typecheck and test to confirm

Step 6: Re-trigger the workflow (optional)

code
mcp_github_github_actions_run_trigger(owner="rivie13", repo="Phoenix-Agentic-Engine-Interface", workflow_id="ci.yml")