Skip to content

Commit 139d01c

Browse files
committed
fix: add npm authentication steps to release workflow
1 parent c0e53cd commit 139d01c

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,23 @@ jobs:
2727
registry-url: 'https://registry.npmjs.org'
2828
- run: pnpm install --no-frozen-lockfile
2929
- run: pnpm build
30+
- name: Force npm auth file
31+
run: |
32+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
33+
npm config get registry
34+
env:
35+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
36+
- name: Verify npm auth
37+
run: |
38+
npm whoami --registry=https://registry.npmjs.org/
39+
npm ping --registry=https://registry.npmjs.org/
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3042
- name: Create release PR or publish
3143
uses: changesets/action@v1
3244
with:
3345
publish: pnpm changeset publish
3446
env:
3547
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3648
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
49+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)