Skip to content
Latchkey

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."

sentry-cli
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

  1. Set fetch-depth: 0 on the checkout step so the full history is available.
  2. Run sentry-cli releases set-commits --auto after checkout.
  3. Confirm commits now attach to the release.
.github/workflows/ci.yml
- uses: actions/checkout@v4
  with:
    fetch-depth: 0

Pass an explicit commit range

If you cannot deepen history, set commits manually with a known previous release reference.

Terminal
sentry-cli releases set-commits "$VERSION" --commit "my-org/my-repo@$PREV_SHA..$GITHUB_SHA"

How to prevent it

  • Use fetch-depth: 0 whenever a step reads git history.
  • Connect the repository in Sentry so --auto can reconcile commits.
  • Record the previous release SHA if you set commits explicitly.

Frequently asked questions

What causes ""could not find any commits""?
actions/checkout fetches depth 1 by default, so there is no prior commit for --auto to diff against and associate.
How do I fix "could not find any commits"?
Fetch full git history

Related guides

References

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