From f313498f1e958fd2ea768f2c5a2bd89947bfc90b Mon Sep 17 00:00:00 2001 From: Spenser Black Date: Thu, 14 Nov 2024 20:34:46 -0500 Subject: [PATCH] Use `.npmrc` to set auth in publish workflow --- .github/workflows/publish.yml | 6 ++++-- .gitignore | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a360c82..d8c4832 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,7 +16,9 @@ jobs: with: node-version: "22.x" cache: pnpm + - name: Setup .npmrc + run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: pnpm install - run: pnpm publish --recursive --access public --no-git-checks - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore index c3456df..a52fc3e 100644 --- a/.gitignore +++ b/.gitignore @@ -115,3 +115,6 @@ dist # Ignore build mistakes **/src/*.js **/src/*.d.ts + +# Created during publish workflow +/.npmrc