AgentSkillsCN

fix-github-actions

当 CI/CD 或 GitHub Actions 工作流出现故障,亟需定位根本原因、在本地重现问题、精准修复、重新运行并验证直至问题彻底解决时,此技能便能派上用场。可通过“修复 GitHub Actions”、“工作流失败”、“CI 失败”、“GH Run 失败”、“修复流水线”等短语触发。

SKILL.md
--- frontmatter
name: fix-github-actions
description: Use when CI/CD or GitHub Actions workflows are failing and need root-cause diagnosis, local reproduction, targeted fixes, reruns, and verification to green. Triggers: "fix github actions", "workflow failing", "ci failed", "gh run failed", "fix pipeline".

Fix GitHub Actions

Goal

Turn red workflows green with evidence-driven debugging and minimal, reliable fixes.

Workflow

  1. Identify failing runs and failing jobs/steps.
  2. Extract exact error logs/artifacts.
  3. Reproduce locally using the same commands/environment assumptions.
  4. Apply minimal fix in code/workflow/scripts.
  5. Re-run local verification gates.
  6. Re-run workflow and confirm green.

Commands

bash
gh run list --limit 30 --json databaseId,workflowName,status,conclusion,headSha,headBranch,url
gh run view <run-id> --log-failed

Verification

  • Run the same lint/test/build commands used by the failing workflow.
  • Do not claim fixed until local checks pass and CI rerun is green.

Notes

  • Prefer fixing root causes over retry-only changes.
  • Keep workflow edits auditable and minimal.