Skip to content

Commit aaf73a5

Browse files
committed
ci: improve npm authentication in publish workflow
1 parent e7214c9 commit aaf73a5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/nodejs-publish.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,19 @@ jobs:
3434
env:
3535
HUSKY: 0
3636

37-
- name: Authenticate to npm
37+
- name: Build
38+
run: pnpm -w build
39+
40+
- name: Verify npm authentication
3841
run: |
39-
printf "//registry.npmjs.org/:_authToken=${NPM_TOKEN}\n" >> ~/.npmrc
42+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
43+
npm whoami
4044
env:
4145
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4246

43-
- name: Build
44-
run: pnpm -w build
45-
4647
- name: Publish with Changesets
4748
run: pnpm release
4849
env:
4950
NPM_CONFIG_PROVENANCE: true
51+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5052
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)