Author identity unknown / "Please tell me who you are" - Git has no user.name/user.email. Set them in the job: git config user.email "ci@example.com" && git config user.name "CI". Also "nothing to commit, working tree clean" exits non-zero in scripts; guard with git diff --cached --quiet || git commit ...
Using this in CI
CI checkouts are shallow and detached by default, which changes the answer this command gives you. Commands that read history, branch names, or tags need the checkout configured for it.
.github/workflows/ci.yml
- uses:actions/checkout@v4with:fetch-depth:0 # history, tags, and git describe all need this- run:|git rev-parse --is-shallow-repository # expect falsegit rev-parse --abbrev-ref HEAD # prints HEAD when detached
Frequently asked questions
git commit: Usage, Options & Common CI Errors?
A commit is a permanent point in history. In CI you usually need a non-interactive message and a configured identity.
What it does?
git commit takes everything currently staged in the index and records it as a new commit with an author, committer, timestamp, and message.
Common errors in CI?
Author identity unknown / "Please tell me who you are" - Git has no user.name/user.email. Set them in the job: git config user.email "ci@example.com" && git config user.name "CI". Also "nothing to commit, working tree clean" exits non-zero in scripts; guard with git diff --cached --quiet || git commit ...