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.
github-actions
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.
.github/workflows/ci.yml
- 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.
Related guides
GitHub Actions tj-actions/changed-files "fatal: ambiguous argument"Fix tj-actions/changed-files "fatal: ambiguous argument" - a shallow checkout lacks the history needed to dif…
GitHub Actions "fatal: not a git repository" after checkout pathFix git "fatal: not a git repository" in GitHub Actions - a step runs git in a directory that checkout never…
GitHub Actions JamesIves/github-pages-deploy-action "permission denied"Fix JamesIves/github-pages-deploy-action permission-denied push errors - the token cannot push to the deploy…