Troubleshoot and fix failing GitHub Actions pipeline steps. Use when user reports a failing pipeline with error output.
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.
Look for key information in the error:
Example error:
Run npm run test -- --coverage
> [email protected] test
> jest --coverage
No tests found, exiting with code 1
Parse this as:
npm run test -- --coverage--passWithNoTests flagRead the workflow file at the specified line:
# If user mentions line 232 of deploy-stacks-main.yml
Look for:
name: of the steprun: command being executedworking-directory: specifiedif: statementsExample:
- name: Stack Unit Tests
working-directory: ./stacks/${{ matrix.stack_env.stack }}
run: npm run test -- --coverage
Common failure patterns:
Tests not found:
--passWithNoTests flag to jest commandModule not found:
Command not found:
Wrong working directory:
working-directory in workflowFix in workflow file when:
--passWithNoTests to workflow run commandFix in package.json when:
--passWithNoTests by defaultFix in source code when:
Update the appropriate file(s) and verify:
Workflow file fix:
# Before