diff Exit Code 1 in CI: Files Differ (Used by Format Checks)
diff exit code 1 means the two inputs differ - a result, not an error. Format checks rely on this to fail when files are unformatted.
A step exiting 1 from diff (or git diff --exit-code) found differences. Many CI "check" gates use this deliberately.
What it means
diff exits 0 when inputs are identical, 1 when they differ, and 2 on a real error (missing file). git diff --exit-code and prettier --check-style flows use exit 1 as "not formatted / changed".
Common causes
- Generated output drifted from the committed version.
- Code is not formatted to the expected style.
- A "no uncommitted changes" gate found a modified file.
How to fix it
Regenerate or reformat the file and commit it so diff is empty. Treat exit 2 (not 1) as the actual error case. This is deterministic - it reflects the file contents.
Related guides
Exit Codes and Signals in CI/CD: A Practical GuideA practical guide to process exit codes and signals in CI/CD - what 1, 2, 124, 126, 127, 130, 137, and 143 me…
CI Exit Code Lookup: What Does This Exit Code Mean?Instant lookup for CI/CD process exit codes - enter a code (137, 127, 143…) to see what it means, whether it…