From cfc0b1b96e9f3d2ba4099ccd03c03d16f8eb3bb2 Mon Sep 17 00:00:00 2001 From: weiping-awx Date: Wed, 26 Aug 2026 15:31:30 +0800 Subject: [PATCH] ci: fix npm publish auth by using NODE_AUTH_TOKEN Stop overwriting setup-node's .npmrc so the registry token is applied on publish. Co-authored-by: Cursor --- .github/workflows/publish.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ecf6495..ae1628d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,14 +17,10 @@ jobs: with: node-version: ${{ env.NODE-VERSION }} registry-url: https://registry.npmjs.org/ - - name: Build and publish to npm + - name: Install run: yarn install --frozen-lockfile - - name: Upload artifacts - run: | - echo always-auth=true > .npmrc - echo "registry=https://registry.npmjs.org/" >> .npmrc - echo //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} > .npmrc - npm publish --access public + - name: Publish to npm + run: npm publish --access public env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} CI: true