Skip to content
Latchkey

stefanzweifel/git-auto-commit "nothing to commit, working tree clean"

git-auto-commit only commits when there are staged changes. If the prior step produced no diff, the action reports a clean tree and makes no commit, which downstream steps may misread as a failure.

What this error means

The git-auto-commit step logs "nothing to commit, working tree clean" and no commit is pushed.

github-actions
nothing to commit, working tree clean
Working tree clean. Nothing to commit.

Common causes

Generator produced no change

The formatter, codegen, or build step output bytes identical to what is already committed.

Files outside the configured glob

Changes landed in paths not matched by file_pattern, so the action sees nothing to stage.

How to fix it

Treat a clean tree as success, and check the file pattern

  1. Confirm the file_pattern matches the paths your step writes.
  2. Read the changes_detected output instead of failing on the clean-tree message.
  3. Gate follow-up steps on changes_detected == true.
.github/workflows/format.yml
- id: commit
  uses: stefanzweifel/git-auto-commit-action@v5
  with:
    file_pattern: 'src/**/*.ts'
- if: ${{ steps.commit.outputs.changes_detected == 'true' }}
  run: echo "committed"

How to prevent it

  • Gate downstream steps on the changes_detected output.
  • Set file_pattern to exactly the paths your generator writes.

Frequently asked questions

What causes ""nothing to commit, working tree clean""?
The formatter, codegen, or build step output bytes identical to what is already committed.
How do I fix "nothing to commit, working tree clean"?
Treat a clean tree as success, and check the file pattern

Related guides

References

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