ci-fetch-log

Fetch complete GitHub Actions job logs and diagnose failed CI jobs from saved evidence.

2.3k|421|Updated Oct 9, 2025
One-click install
npx skills add https://github.com/radixark/miles --skill ci-fetch-log
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ci-fetch-log
Source: https://github.com/radixark/miles/tree/main/.claude/skills/ci-fetch-log
Command: npx skills add https://github.com/radixark/miles --skill ci-fetch-log

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

CI failures on GitHub Actions are hard to investigate when logs are viewed piecemeal in the browser, pasted as snippets, or lost after reruns. This Skill downloads complete job logs via the gh CLI, writes an auditable completeness manifest, and optionally diagnoses failed jobs strictly from the saved evidence.

Core Features & Use Cases

  • Complete log collection: Resolves a PR number, run URL, or job URL to a pinned workflow attempt, fetches every selected job's full log with gh api or gh run view, and records per-job completeness in a machine-readable manifest.json.
  • Failure diagnosis: Analyzes only jobs with complete saved logs, classifying each failure (test_failure, infra, timeout, etc.) with verbatim line-cited excerpts written to per-job report.md files.
  • Auditable artifacts: Produces run.json, manifest.json, and summary.md in a timestamped directory outside the repository so results can be reviewed or consumed by other tools later.
  • Use Case: A teammate asks why CI failed on PR #482. You invoke the Skill with the PR number; it resolves the head SHA's newest run, saves all failed-job logs, and returns a grouped diagnosis with exact log line citations and a recommended next step.

Quick Start

Fetch the complete logs for the latest CI run on PR 482 and diagnose any failed jobs from the saved evidence.

Frequently Asked Questions about ci-fetch-log

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I download complete GitHub Actions job logs from the command line?

Use the gh CLI: run `gh api /repos/<owner>/<repo>/actions/jobs/<job_id>/logs` to save a job's full log, with `gh run view <run_id> --log --job <job_id>` as a fallback. This Skill automates both commands and records which succeeded per job.

How do I find the workflow run for a pull request's latest commit?

Resolve the PR head SHA with `gh pr view <number> --json headRefOid`, then list runs for that commit with `gh run list --commit <sha>`. The Skill picks the newest run by createdAt and databaseId and never falls back to an older commit.

Can I fetch logs for only one specific job in a workflow run?

Yes, but single-job selection requires the `--only` flag together with a job URL, an explicit `--job <id>`, or a `--job-name <glob>` selector. Without `--only`, the Skill always selects the whole run to guarantee completeness.

Why does gh authentication fail when fetching CI logs?

Authentication fails when GH_TOKEN or GITHUB_TOKEN is missing, GH_CONFIG_DIR points elsewhere, or shell startup skips credential setup. Run `gh auth status --hostname github.com` in the exact shell that will execute fetches; the Skill stops before any fetch if this gate fails.

What are the limitations of diagnosing CI failures from saved logs?

Diagnosis only covers jobs whose saved log is verified complete; queued, running, or partially fetched jobs are listed separately and never diagnosed from partial evidence. Every claim must cite exact line spans from the saved log, and weak evidence yields an 'instrument first, fix later' recommendation.