Skip to content

Commit 09e01fe

Browse files
committed
fix(ci): add Node.js 22 setup, manual trigger, and failure alerting to sentry-release workflow
The workflow failed on its first run (0.24.0) because the ubuntu-latest runner ships Node.js v20 but the sentry npm package requires >=22. - Add actions/setup-node@v6 with node-version 22 - Add workflow_dispatch trigger with 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
1 parent 38a48b5 commit 09e01fe

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)