Skip to content

Commit f9e1bae

Browse files
authored
Configure NPM_AUTH_TOKEN on the node setup step
1 parent 65e420c commit f9e1bae

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/release.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches:
55
- main
6+
- update-publish-workflow
67
workflow_dispatch: {}
78
jobs:
89
release:
@@ -20,9 +21,11 @@ jobs:
2021
git config user.email "github-actions@github.com"
2122
- name: Check whether it's the latest commit
2223
run: if [[ $(git ls-remote origin -h ${{ github.ref }} | cut -f1) != ${{ github.sha }} ]]; then exit 1; fi
23-
- name: Setup Node.js
24+
- name: Setup Node
2425
uses: actions/setup-node@v4.0.2
25-
with:
26+
env:
27+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
28+
with:
2629
node-version: 20
2730
registry-url: https://registry.npmjs.org
2831
- name: Install build dependencies
@@ -44,7 +47,7 @@ jobs:
4447
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4548
GITHUB_REPOSITORY: ${{ github.repository }}
4649
GITHUB_REF: ${{ github.ref }}
47-
- name: Setup NPM registry
48-
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc
50+
# - name: Setup NPM registry
51+
# run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc
4952
- name: Release to NPM
50-
run: npm publish --access public
53+
run: npm publish --access public

0 commit comments

Comments
 (0)