Skip to content

Commit 53ddac0

Browse files
fix: update npm authentication logic and add token validation
1 parent 8e1386c commit 53ddac0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/release.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ jobs:
3434
- name: Test
3535
run: pnpm test
3636
- name: Setup npm auth
37+
env:
38+
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ESLINT }}
3739
run: |
38-
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN_ESLINT }}" > ~/.npmrc
39-
cat ~/.npmrc
40+
echo "Token length: ${#NPM_TOKEN}"
41+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
42+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
43+
npm whoami || echo "whoami failed - token may be invalid"
4044
- name: Release
4145
env:
4246
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)