Skip to content

Commit 7f9e745

Browse files
committed
fix(release): add NPM token check in release workflow to ensure NODE_AUTH_TOKEN is set before proceeding with release steps
1 parent 4a63186 commit 7f9e745

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ jobs:
1313
release:
1414
runs-on: ubuntu-latest
1515
steps:
16+
- name: Check NPM Token
17+
id: check-token
18+
run: |
19+
if [ -z "${{ secrets.NODE_AUTH_TOKEN }}" ]; then
20+
echo "npm-token-exists=false" >> $GITHUB_OUTPUT
21+
echo "⚠️ NODE_AUTH_TOKEN secret is not set. Skipping release steps."
22+
else
23+
echo "npm-token-exists=true" >> $GITHUB_OUTPUT
24+
echo "✅ NODE_AUTH_TOKEN secret is available."
25+
fi
26+
1627
- name: Checkout
1728
uses: actions/checkout@v4
1829

@@ -32,6 +43,7 @@ jobs:
3243
uses: actions/setup-node@v4
3344
with:
3445
node-version: '22.18.0'
46+
registry-url: 'https://registry.npmjs.org'
3547

3648
- name: Setup PNPM
3749
uses: pnpm/action-setup@v4
@@ -42,4 +54,12 @@ jobs:
4254
run: pnpm install --frozen-lockfile
4355

4456
- name: Build
45-
run: pnpm build
57+
run: pnpm build
58+
59+
# - name: Release
60+
# if: steps.check-token.outputs.npm-token-exists == 'true'
61+
# env:
62+
# NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
63+
# run: |
64+
# # Add your release commands here
65+
# # e.g., npx changeset publish

0 commit comments

Comments
 (0)