GitHub Actions EndBug/add-and-commit "nothing to commit"
EndBug/add-and-commit stages and commits changes. When a prior step produced no modifications, there is nothing to commit; depending on configuration this surfaces as a no-op or a failing step in workflows that assumed a commit would happen.
What this error means
An add-and-commit step reports nothing to commit and the working tree is clean, breaking a workflow that expected a generated change to be committed.
Nothing to commit, working tree clean.
Error: Process completed with exit code 1.Common causes
No changes produced
The generating step (codegen, formatting, lockfile update) made no changes, so the index is empty.
Files ignored or pathspec mismatch
Changes were written to paths excluded by .gitignore or not matched by the add pattern.
How to fix it
Make empty commits a no-op, not a failure
- Confirm the prior step actually changes tracked files.
- Adjust the add pathspec to include the generated files.
- Treat a clean tree as success rather than an error in downstream logic.
- uses: EndBug/add-and-commit@v9
with:
add: 'generated/'
message: 'chore: update generated files'How to prevent it
- Verify the generation step writes tracked files.
- Do not treat a clean working tree as a hard failure.