sentry-cli "could not find any commits" for a release in CI
sentry-cli set-commits walks your git history to attach commits to a release, but CI checkouts are shallow by default (depth 1), so the CLI sees no commit range and reports it cannot find any commits.
What this error means
A sentry-cli releases set-commits --auto step fails or warns with "could not find any commits" or "Could not determine any commits to be associated automatically."
error: could not find any commits. Perhaps you need to deepen the git history (e.g. fetch with depth)?Common causes
Shallow checkout hides commit history
actions/checkout fetches depth 1 by default, so there is no prior commit for --auto to diff against and associate.
The repository integration is not connected
Without Sentry knowing the repo via a code integration, set-commits has no remote history to reconcile against either.
How to fix it
Fetch full git history
- Set
fetch-depth: 0on the checkout step so the full history is available. - Run
sentry-cli releases set-commits --autoafter checkout. - Confirm commits now attach to the release.
- uses: actions/checkout@v4
with:
fetch-depth: 0Pass an explicit commit range
If you cannot deepen history, set commits manually with a known previous release reference.
sentry-cli releases set-commits "$VERSION" --commit "my-org/my-repo@$PREV_SHA..$GITHUB_SHA"How to prevent it
- Use
fetch-depth: 0whenever a step reads git history. - Connect the repository in Sentry so
--autocan reconcile commits. - Record the previous release SHA if you set commits explicitly.