From 15ec100dcbce2c108750ea5db10654d5159bd170 Mon Sep 17 00:00:00 2001 From: Diego Rodrigues de Sa e Souza <8016841+diegosouzapw@users.noreply.github.com> Date: Sat, 14 Feb 2026 04:26:05 -0300 Subject: [PATCH] =?UTF-8?q?fix(ci):=20write=20.npmrc=20explicitly=20for=20?= =?UTF-8?q?npm=20auth=20=E2=80=94=20support=20both=20secrets=20and=20vars?= =?UTF-8?q?=20(#17)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: diegosouzapw --- .github/workflows/npm-publish.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 4096da2ad0..7af646a818 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -35,7 +35,18 @@ jobs: npm version "$VERSION" --no-git-tag-version --allow-same-version echo "Publishing version: $VERSION" + - name: Configure npm auth + run: | + TOKEN="${NPM_TOKEN_SECRET:-$NPM_TOKEN_VAR}" + if [ -z "$TOKEN" ]; then + echo "❌ NPM_TOKEN not found in secrets or vars" + exit 1 + fi + echo "//registry.npmjs.org/:_authToken=${TOKEN}" > ~/.npmrc + echo "✅ npm auth configured" + env: + NPM_TOKEN_SECRET: ${{ secrets.NPM_TOKEN }} + NPM_TOKEN_VAR: ${{ vars.NPM_TOKEN }} + - name: Publish to npm run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN || vars.NPM_TOKEN }}