Skip to content
Latchkey

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

  1. Confirm the prior step actually changes tracked files.
  2. Adjust the add pathspec to include the generated files.
  3. 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.

Frequently asked questions

What causes ""add-and-commit: nothing to commit""?
The generating step (codegen, formatting, lockfile update) made no changes, so the index is empty.
How do I fix "add-and-commit: nothing to commit"?
Make empty commits a no-op, not a failure

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card