sentry-cli releases set-commits for Suspect Commits
sentry-cli releases set-commits links the commits in a release so Sentry can attribute new issues to suspect commits and notify authors.
Suspect commits are one of Sentry's most useful features, but they only work if the release knows which commits it contains. set-commits provides that mapping in CI.
What it does
sentry-cli releases set-commits attaches a commit range to a release. --auto infers the repository and range from the local git history and the previous release; --local is similar but does not require the repo to be configured in Sentry's integration.
Common usage
VERSION=$(sentry-cli releases propose-version)
sentry-cli releases set-commits "$VERSION" --auto
# explicit range when --auto cannot infer it
sentry-cli releases set-commits "$VERSION" \
--commit "acme/web@$PREV_SHA..$CURRENT_SHA"Options
| Flag | What it does |
|---|---|
| --auto | Infer repo and commit range automatically |
| --local | Use local git without the Sentry repo integration |
| --commit "repo@from..to" | Provide an explicit commit range |
| --ignore-missing | Do not fail if the previous commit is gone |
| --initial-depth <n> | How far back to look for the base commit |
In CI
Most CI checkouts are shallow (fetch-depth 1), which hides the history set-commits needs. Fetch full history (actions/checkout with fetch-depth: 0) or pass --ignore-missing so a missing base commit does not fail the job.
Common errors in CI
"error: Could not find the SHA of the previous release" or "Unable to find commits" usually means a shallow clone; deepen the checkout. "error: Given commit range is not valid" means the from..to SHAs are not both reachable. "error: Could not determine repository" means --auto could not match a Sentry-linked repo; use --local or --commit with an explicit repo@range.