Skip to content

Commit 38818d0

Browse files
authored
ci: fix sentry-release workflow Node.js version and add manual trigger (#643)
## Summary Fixes the [failed Sentry Release workflow](https://github.com/getsentry/cli/actions/runs/23912025434/job/69736210175) for 0.24.0. **Root cause:** `ubuntu-latest` ships Node.js v20.20.2 but the `sentry` npm package requires `>=22`: ``` Error: sentry requires Node.js 22 or later (found v20.20.2). ``` ## Changes - Add `actions/setup-node@v6` with `node-version: 22` before `npm install` - Add `workflow_dispatch` trigger with a `version` input for manual re-runs - Add `gh issue create` step on `failure()` so broken releases file a bug automatically - Add `issues: write` permission for the failure step ## After merging Re-run for 0.24.0: ``` gh workflow run sentry-release.yml -f version=0.24.0 ```
1 parent 38a48b5 commit 38818d0

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

.github/workflows/sentry-release.yml

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,35 @@ name: Sentry Release
22
on:
33
release:
44
types: [published]
5+
workflow_dispatch:
6+
inputs:
7+
version:
8+
description: "Release version (e.g., 0.24.0)"
9+
required: true
10+
type: string
511

612
permissions:
713
contents: read
14+
issues: write
815

916
jobs:
1017
finalize:
1118
name: Finalize Sentry Release
1219
runs-on: ubuntu-latest
13-
# Skip pre-releases (nightlies, dev versions)
14-
if: "!github.event.release.prerelease"
20+
# Skip pre-releases (nightlies, dev versions) on automatic trigger;
21+
# always run on manual dispatch.
22+
if: github.event_name == 'workflow_dispatch' || !github.event.release.prerelease
1523
env:
1624
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
1725
# Tag names are bare semver (e.g., "0.24.0", no "v" prefix),
1826
# matching both the npm package version and Sentry release version.
19-
VERSION: ${{ github.event.release.tag_name }}
27+
VERSION: ${{ github.event.release.tag_name || inputs.version }}
2028
steps:
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v6
31+
with:
32+
node-version: 22
33+
2134
- name: Install CLI
2235
run: npm install -g "sentry@${VERSION}"
2336

@@ -33,3 +46,21 @@ jobs:
3346

3447
- name: Create deploy
3548
run: sentry release deploy "sentry/${VERSION}" production
49+
50+
- name: File issue on failure
51+
if: failure()
52+
env:
53+
GH_TOKEN: ${{ github.token }}
54+
run: |
55+
gh issue create \
56+
--repo "${{ github.repository }}" \
57+
--title "Sentry release finalization failed for ${VERSION}" \
58+
--body "The [Sentry Release workflow](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed for version \`${VERSION}\`.
59+
60+
Trigger: \`${{ github.event_name }}\`
61+
62+
Please investigate and re-run manually if needed:
63+
\`\`\`
64+
gh workflow run sentry-release.yml -f version=${VERSION}
65+
\`\`\`" \
66+
--label bug

0 commit comments

Comments
 (0)