CI Pipeline Failed
Error message
Error: Job failed — exit code 1
Quick summary
A step in the CI pipeline (build, test, lint) returned a non-zero exit code, causing the pipeline to fail.
Why this happens
A test failed — the code has a bug or the test is incorrect
The build step failed due to a compilation error or missing dependency
A linting step found code quality issues
The pipeline configuration is incorrect (wrong commands, missing steps)
Minimal example
steps:
- run: npm test # a test fails, pipeline stops
- run: npm run build # never reached# Fix the failing test first
# Then the pipeline passes:
steps:
- run: npm test # all tests pass
- run: npm run build # runs successfullyA failing test stops the pipeline. The fix addresses the test failure so the pipeline can continue to the build step.
How to diagnose
Check the pipeline logs for the failing step
Identify which step failed and read the error message
Reproduce the failure locally with the same commands
Check if the failure is due to a flaky test or environment issue
How to fix
Fix the code that caused the test or build to fail
Update the test if it is incorrect or outdated
Fix the pipeline configuration (correct commands, proper environment)
Re-run the pipeline after fixing the issue
How to prevent
Run tests locally before pushing code
Use pre-commit hooks to catch issues early
Keep pipeline configurations version-controlled and tested