Skip to content

Commit 253b120

Browse files
committed
fix(ci): add safety check to prevent publishing stable version as beta
Verify that package.json version contains '-beta-' after snapshot versioning. If the snapshot step silently fails, the build errors out instead of accidentally publishing a stable version under the beta tag.
1 parent 55998ff commit 253b120

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ jobs:
9595
run: |
9696
git checkout "$ORIGINAL_SHA"
9797
pnpm changeset version --snapshot beta
98+
99+
VERSION=$(node -p "require('./packages/login-widget/package.json').version")
100+
if [[ "$VERSION" != *"-beta-"* ]]; then
101+
echo "::error::Expected a snapshot version containing '-beta-' but got '$VERSION'. Aborting publish to prevent releasing a stable version under the beta tag."
102+
exit 1
103+
fi
104+
echo "Publishing snapshot version: $VERSION"
105+
98106
pnpm changeset publish --tag beta
99107
env:
100108
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)