Agent skill
github-actions-troubleshooting
Troubleshoot and fix failing GitHub Actions pipeline steps. Use when user reports a failing pipeline with error output.
Install this agent skill to your Project
npx add-skill https://github.com/moogah/claude_skills/tree/main/github-actions-troubleshooting
SKILL.md
GitHub Actions Troubleshooting
Overview
When a GitHub Actions pipeline fails, systematically identify the problem, locate the failing step, and fix it. This skill helps interpret error output and determine the right fix.
When to Use This Skill
- User reports a failing GitHub Actions workflow
- User provides error output from CI
- User mentions a specific failing step (e.g., "Stack Unit Tests failed")
- Need to fix pipeline configuration issues
Troubleshooting Workflow
Step 1: Parse the Error Output
Look for key information in the error:
- Which workflow file: Often shown in logs or URL
- Step name: e.g., "Stack Unit Tests", "Run unit tests"
- Line number: e.g., "line 232 of deploy-stacks-main.yml"
- Error message: The actual failure (test failure, command not found, etc.)
Example error:
Run npm run test -- --coverage
> oncall-data-sync-stack@1.0.0 test
> jest --coverage
No tests found, exiting with code 1
Parse this as:
- Command:
npm run test -- --coverage - Problem: No tests found, jest exiting with code 1
- Likely fix needed: Add
--passWithNoTestsflag
Step 2: Locate the Failing Step
Read the workflow file at the specified line:
# If user mentions line 232 of deploy-stacks-main.yml
Look for:
- The
name:of the step - The
run:command being executed - Any
working-directory:specified - Conditional
if:statements
Example:
- name: Stack Unit Tests
working-directory: ./stacks/${{ matrix.stack_env.stack }}
run: npm run test -- --coverage
Step 3: Identify the Root Cause
Common failure patterns:
Tests not found:
- Symptom: "No tests found, exiting with code 1"
- Cause: Test files deleted or no tests exist
- Fix: Add
--passWithNoTestsflag to jest command
Module not found:
- Symptom: "Cannot find module './some-file'"
- Cause: File deleted but still imported
- Fix: Remove import or restore file
Command not found:
- Symptom: "command not found: some-command"
- Cause: Missing dependency or wrong command name
- Fix: Install dependency or correct command
Wrong working directory:
- Symptom: "package.json not found" or similar
- Cause: Command run in wrong directory
- Fix: Update
working-directoryin workflow
Step 4: Determine Where to Fix
Fix in workflow file when:
- Issue is with how the step runs (flags, directory, conditions)
- Need to add/remove pipeline-specific configuration
- Example: Adding
--passWithNoTeststo workflow run command
Fix in package.json when:
- Issue affects both local and CI execution
- Test script needs permanent modification
- Want consistent behavior everywhere
- Example: Changing test script to include
--passWithNoTestsby default
Fix in source code when:
- Actual code/test failure
- Import errors, type errors, etc.
- Test assertions failing
Step 5: Apply the Fix
Update the appropriate file(s) and verify:
Workflow file fix:
# Before
run: npm run test -- --coverage
# After
run: npm run test -- --coverage --passWithNoTests
Package.json fix:
{
"scripts": {
"test": "jest --passWithNoTests"
}
}
Common Issues and Fixes
Empty Test Suite
Error: "No tests found, exiting with code 1"
Fix: Add --passWithNoTests to jest command (workflow or package.json)
Multiple Workflow Files
Error: Unclear which workflow is failing Fix: Check error output for workflow name, or look at GitHub Actions UI for which workflow ran
Matrix Strategy Failures
Error: Only one matrix item failing Fix: cd to that specific directory and run the command locally to debug
Cached Dependencies
Error: "Module not found" but package.json has it Fix: May be cache issue - workflow often has cache step, check cache key
Example Troubleshooting Session
User reports:
"Stack Unit Tests failing with 'No tests found' error"
Actions:
- Ask for error output or workflow file name
- User provides: "Line 232 of deploy-stacks-main.yml"
- Read that file at line 232:
yaml
- name: Stack Unit Tests run: npm run test -- --coverage - Identify issue: jest with no tests exits with code 1
- Determine fix location: Both package.json (permanent) and workflow (explicit)
- Apply fix:
- Update package.json:
"test": "jest --passWithNoTests" - Update workflow:
run: npm run test -- --coverage --passWithNoTests
- Update package.json:
- Verify fix will work
Best Practices
- Read the actual workflow file - Don't guess, verify what's running
- Check working directory - Commands run in specific contexts
- Consider both locations - Sometimes fix in package.json is cleaner
- Test locally first - Run the same command locally to verify fix
- Update related workflows - If multiple workflows run same command
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
characterization-testing
Guide for characterization testing - capturing current system behavior to enable safe refactoring. Use when working with legacy code, undocumented systems, or code that needs modification but lacks tests. Helps create a safety net before making changes by testing what the code actually does (not what it should do).
bead-implementation
Execute on a Beads issue with proper discovery workflow and mandatory session close protocol. Use when starting work on a bead, during implementation when discovering new work that should be externalized, or when completing a session to ensure all work is properly committed.
architecture-analyzer
Perform in-depth architectural analysis of codebases through iterative dialog and visual diagrams. Use when users want to understand their software architecture, explore design patterns and anti-patterns, evaluate potential architectural changes, or gain deep insights into code structure and relationships. Particularly valuable for onboarding to unfamiliar codebases, assessing technical debt, planning refactoring efforts, or understanding how components interact across system boundaries.
openspec-to-beads
Convert OpenSpec artifacts (proposal.md, design.md, tasks.md, specs/) into self-contained Beads issues for implementation tracking. Use when you have completed OpenSpec planning artifacts and need to create trackable implementation tasks, or when converting any specification or design document into actionable Beads issues.
skill-learner
Reviews conversation context to identify learnings and patterns that should be captured in skills. Use when the user asks to review the session for skill creation or updates.
writing-elisp
Comprehensive guidance for writing high-quality, idiomatic, modern Emacs Lisp code with incremental validation. Use when writing or modifying elisp functions, especially complex nested forms with cl-loop, multiple let* bindings, or lambdas. Covers modern features, naming conventions, documentation standards, error handling, code quality, and performance.
Didn't find tool you were looking for?