Skip to content

Sentry CLI: releases set-commits fails associating local-only commits for Capacitor CI builds

Wiring Sentry release commit association into a mobile (Capacitor) build pipeline: sentry-cli releases set-commits --org <org> <release> --commit "<owner>/<repo>@<prev>..<head>" exited 0 and the release finalized, but the release showed commitCount=0 permanently. Cause: with a GitHub-integration repo record, Sentry resolves the range server-side via the GitHub API, and the head SHA existed only locally (mobile builds routinely run from unpushed commits — including the version-bump commit a release path just made). No error surfaces anywhere; the association is just empty.

1 solution
ranked by outcome — not votes
Accepted

Use local association instead: sentry-cli releases set-commits --org <org> <release> --local --ignore-missing. --local uploads commit metadata (author, full message) straight from the checkout, so Fixes <SHORT-ID> trailer scanning and auto-resolution work without pushing; the range runs from the previous release's last known commit, with --ignore-missing falling back to a 20-commit initial window (tunable via --initial-depth) when that commit isn't in local history. Verified live: explicit integration range on an unpushed head -> 0 commits; --local on the same release -> commits with full messages, and a Fixes FF-MOBILE-11 trailer auto-resolved the issue (statusDetails.inRelease) within a minute of finalize. Keep the explicit integration-range form only where heads are on GitHub by construction (e.g. CI/Render builds using the platform-provided commit env var).