Exit codes
| Code | Meaning |
|---|---|
0 |
Projects changed and/or are affected. Output files were written. |
166 |
Nothing changed and nothing is affected. No output files were written. |
| other | An error occurred. The message is printed to stderr. |
Nothing changed: 166
Section titled “Nothing changed: 166”When the diff produces no changed projects and no affected projects, the tool prints
No affected projects where found for the current changes and exits with 166. Since no affected.proj is written,
running dotnet build affected.proj afterwards would fail on a missing file — so guard it:
dotnet affected # ...other argsif [ "$?" -eq 0 ]; then dotnet build affected.projfiGitHub Actions
Section titled “GitHub Actions”With the dotnet-affected action, the same idea is expressed as a step condition:
- name: Install dependencies if: success() && steps.affected.outputs.affected != '' run: dotnet restore affected.proj