Fix GitHub Actions CI failures using GitHub CLI (gh): inspect runs/logs, identify root cause, patch workflows/code, rerun jobs, and summarize verification. Use when GitHub Actions CI is failing or needs diagnosis.
التثبيت
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Fix GitHub Actions CI failures using GitHub CLI (gh): inspect runs/logs, identify root cause, patch workflows/code, rerun jobs, and summarize verification. Use when GitHub Actions CI is failing or needs diagnosis.
CI fix (GitHub Actions)
Goal
Get CI green quickly with minimal, reviewable diffs.
Use gh to locate failing runs, inspect logs/artifacts, rerun jobs, and confirm the fix.
Inputs to ask for (if missing)
Repo (OWNER/REPO) and whether this is a PR or branch build.
Failing run URL/ID (or PR number / branch name).
What "green" means (required workflows? allowed flaky reruns?).
Any constraints (no workflow edits, no permission changes, no force-push, etc.).
If changing triggers/permissions/secrets, call out risk and get explicit confirmation.
Verify in GitHub Actions
Rerun only failures: gh run rerun <id> --failed
Rerun a specific job (note: job databaseId): gh run view <id> --json jobs --jq '.jobs[] | {name,databaseId,conclusion}'
Watch until done: gh run watch <id> --compact --exit-status
Manually trigger: gh workflow run <workflow> --ref <branch>
Safety notes
Avoid pull_request_target (and any change that runs untrusted fork code with secrets) unless the user explicitly requests it and understands the security tradeoffs.
Keep workflow permissions: least-privilege; don’t broaden token access “just to make it pass”.