Skip to content

Commit a0ded19

Browse files
authored
ci: use production environment for sentry-release auth token (#645)
## Summary Fixes the [second sentry-release failure](https://github.com/getsentry/cli/actions/runs/23917846862/job/69756252213): ``` Error: Not authenticated. Run 'sentry auth login' first. ``` Two issues: 1. **Missing environment** — `SENTRY_AUTH_TOKEN` is scoped to the `production` environment. Without `environment: production` on the job, the secret resolves to empty. 2. **Wrong release version** — The workflow used `sentry/${VERSION}` (e.g., `sentry/0.24.0`) but `Sentry.init()` and sourcemap uploads both use bare semver (`0.24.0`). Events would never be associated with the release. ## Changes - Add `environment: production` to the `finalize` job - Drop `sentry/` prefix from all release version references to match `Sentry.init()` (`release: CLI_VERSION` in `telemetry.ts:417`) and sourcemap uploads (`release: VERSION` in `build.ts:179`)
1 parent 38818d0 commit a0ded19

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

.github/workflows/sentry-release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ jobs:
1717
finalize:
1818
name: Finalize Sentry Release
1919
runs-on: ubuntu-latest
20+
environment: production
2021
# Skip pre-releases (nightlies, dev versions) on automatic trigger;
2122
# always run on manual dispatch.
2223
if: github.event_name == 'workflow_dispatch' || !github.event.release.prerelease
2324
env:
2425
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
2526
# Tag names are bare semver (e.g., "0.24.0", no "v" prefix),
26-
# matching both the npm package version and Sentry release version.
27+
# matching the npm package version, Sentry.init() release, and sourcemap uploads.
2728
VERSION: ${{ github.event.release.tag_name || inputs.version }}
2829
steps:
2930
- name: Setup Node.js
@@ -35,17 +36,17 @@ jobs:
3536
run: npm install -g "sentry@${VERSION}"
3637

3738
- name: Create release
38-
run: sentry release create "sentry/${VERSION}" --project cli
39+
run: sentry release create "${VERSION}" --project cli
3940

4041
- name: Set commits
4142
continue-on-error: true
42-
run: sentry release set-commits "sentry/${VERSION}" --auto
43+
run: sentry release set-commits "${VERSION}" --auto
4344

4445
- name: Finalize release
45-
run: sentry release finalize "sentry/${VERSION}"
46+
run: sentry release finalize "${VERSION}"
4647

4748
- name: Create deploy
48-
run: sentry release deploy "sentry/${VERSION}" production
49+
run: sentry release deploy "${VERSION}" production
4950

5051
- name: File issue on failure
5152
if: failure()

0 commit comments

Comments
 (0)