Skip to content

Commit 0b691fb

Browse files
committed
fix(npm-release): enhance npm publish command to handle prerelease tags
1 parent 8acd007 commit 0b691fb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/npm-release.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,12 @@ jobs:
244244
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
245245

246246
- name: Publish to npm with OIDC
247-
run: npm publish --provenance --access public
247+
run: |
248+
VERSION="${{ env.NEW_VERSION }}"
249+
# Extract prerelease identifier if present (e.g., "beta" from "1.0.0-beta.1")
250+
if [[ "$VERSION" == *"-"* ]]; then
251+
TAG=$(echo "$VERSION" | sed 's/.*-\([a-zA-Z]*\).*/\1/')
252+
npm publish --provenance --access public --tag "$TAG"
253+
else
254+
npm publish --provenance --access public
255+
fi

0 commit comments

Comments
 (0)