Git diff returns “Error: Process completed with exit code 1.” Github Actions

Viewed 1479

The following command git diff --no-index --output=restapi-diff.txt latest-restapi.json restapi.json returns exit code 1 without any further details. When using actions checkout.

1 Answers

Actually, there was/is no problem. Figured out, linux diff (similar to gits diff check) and gits git diff returns 1 if there are changes or differences between files and 0 otherwise.

So exit status 1 does not necessarily indicate a fail when using diff (linux) or git diff from git.

The right thing to do is continue-on-error when using github actions or ignore this status in other build systems.

Related