Skip to content
github-actions-troubleshooter logo

GitHub Actions Troubleshooter

github-actions-troubleshooter

Diagnose and fix GitHub Actions workflow failures, CI/CD pipeline issues, YAML syntax errors, and workflow configuration problems. Use when debugging failed CI runs, fixing workflow errors, or optimizing GitHub Actions. Keywords: github actions, CI, workflow, pipeline, yml, yaml, actions failure,...

SKILL.md

Full skill instructions

GitHub Actions Troubleshooter

Diagnoses and fixes GitHub Actions workflow failures and configuration issues.

Instructions

When activated, follow this systematic troubleshooting approach:

1. Identify the Failure

Get workflow status:

gh run list --limit 5                    # Recent runs
gh run view <run-id>                     # Specific run details
gh run view <run-id> --log-failed        # Failed job logs only

Analyze the failure:

  • Parse error messages from logs
  • Identify which job/​step failed
  • Note the exit code and error type
  • Check if it's intermittent or consistent

2. Common Failure Categories

YAML Syntax Errors
  • Invalid indentation (must use spaces, not tabs)
  • Missing required fields (name, on, jobs)
  • Invalid step format
  • Quote escaping issues

Fix approach:

  • Read the workflow file with Read tool
  • Validate YAML structure
  • Check GitHub Actions syntax documentation
  • Use Edit tool to fix syntax
Dependency/​Setup Issues
  • Node/​Python/​etc version mismatches
  • Missing dependencies in package.json/​requirements.txt
  • Cache invalidation needed
  • Setup action version incompatibility

Fix approach:

# Pin versions explicitly
- uses: actions/​setup-node@v4
  with:
    node-version: '20'
    cache: 'pnpm'
Test/​Build Failures
  • Tests failing in CI but passing locally
  • Environment variable differences
  • File path issues (case sensitivity on Linux)
  • Missing environment secrets

Fix approach:

  • Compare local vs CI environment
  • Check for hardcoded paths
  • Verify secrets are configured
  • Add debugging output
Permission Errors
  • GITHUB_TOKEN insufficient permissions
  • File permission issues
  • Branch protection violations

Fix approach:

permissions:
  contents: write
  pull-requests: write
  checks: read
Timeout/​Performance Issues
  • Jobs exceeding 6-hour limit
  • Slow dependency installation
  • Missing caching
  • Inefficient matrix strategies

Fix approach:

  • Add caching for dependencies
  • Parallelize independent jobs
  • Optimize test suites
  • Use workflow artifacts efficiently

3. Diagnostic Workflow

Step 1: Read the workflow file

# Find workflow files
fd -e yml -e yaml . .github/​workflows

Step 2: Get recent run logs

# View latest failed run
gh run view --log-failed

# Or specific run by ID
gh run view 1234567890 --log

Step 3: Identify root cause

  • Parse error messages
  • Check for known patterns
  • Review recent changes with git log
  • Compare with working runs

Step 4: Apply fix

  • Use Edit tool for workflow changes
  • Test locally if possible
  • Create PR for review
  • Monitor next run

4. Common Fixes

Format Check Failures (Prettier/​ESLint)
# Before commit, run formatters
- name: Format code
  run: pnpm exec prettier --write .

# Or enforce in CI
- name: Check formatting
  run: pnpm exec prettier --check .
Missing Environment Variables
env:
  NODE_ENV: production
  API_URL: ${{ secrets.API_URL }}

jobs:
  build:
    env:
      CUSTOM_VAR: value
Caching Dependencies
- uses: actions/​setup-node@v4
  with:
    node-version: '20'
    cache: 'pnpm'  # or 'npm', 'yarn'

# Or manual cache
- uses: actions/​cache@v4
  with:
    path: ~/​.cache
    key: ${{ runner.os }}-cache-${{ hashFiles('**/​pnpm-lock.yaml') }}
Matrix Strategy for Multiple Versions
strategy:
  matrix:
    node-version: [18, 20, 22]
    os: [ubuntu-latest, windows-latest]
jobs:
  test:
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/​setup-node@v4
        with:
          node-version: ${{ matrix.node-version }}

5. Project-Specific Context

This project uses:

  • Package Manager: pnpm
  • Pre-commit checks: pnpm run pre-commit (format + lint + typecheck)
  • Common CI tasks: format check, typecheck, build, test

Standard workflow pattern:

name: CI
on: [push, pull_request]
jobs:
  ci:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/​checkout@v4
      - uses: pnpm/​action-setup@v2
        with:
          version: 8
      - uses: actions/​setup-node@v4
        with:
          node-version: '20'
          cache: 'pnpm'
      - run: pnpm install
      - run: pnpm run pre-commit
      - run: pnpm run test
      - run: pnpm run build

6. Output Format

Present findings as:

🔍 Diagnosis

  • Job: format-check
  • Step: Run prettier --check
  • Error: Code style issues found in 11 files
  • Root Cause: Files not formatted with Prettier

🔧 Fix Applied

# File: .github/​workflows/​ci.yml:15
- name: Format check
  run: pnpm exec prettier --config .config/​.prettierrc --check .

✅ Verification

  • Run locally: pnpm exec prettier --write .
  • Commit formatted files
  • Monitor next CI run

7. Prevention & Best Practices

Pre-commit hooks:

  • Run formatters before commit
  • Validate locally before pushing
  • Use pnpm run pre-commit

Workflow best practices:

  • Pin action versions (actions/​checkout@v4 not @main)
  • Use caching for dependencies
  • Set explicit timeouts
  • Add descriptive step names
  • Use if: failure() for debugging steps

Security:

  • Minimize GITHUB_TOKEN permissions
  • Don't log secrets
  • Use secrets context, not env vars for sensitive data
  • Review third-party actions before use

Tools to Use

  • Read: View workflow YAML files
  • Edit: Fix workflow configuration
  • Bash(gh:*): Get run logs, workflow status
  • Bash(git:*): Check recent changes, blame
  • Grep: Search for patterns in logs/​workflows
  • WebFetch: Check GitHub Actions documentation

Example Activation

These user requests will trigger this skill:

  • "Why is my GitHub Actions workflow failing?"
  • "Fix the CI pipeline error"
  • "The format check is failing in CI"
  • "Help debug this workflow YAML"
  • "My tests pass locally but fail in GitHub Actions"

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View