From 58c40d230c692aec08bea9060fa882264b418c67 Mon Sep 17 00:00:00 2001 From: Fabio1988 Date: Tue, 18 Aug 2026 20:27:46 +0200 Subject: [PATCH] ci: give yarn an empty NODE_AUTH_TOKEN on publish setup-node's registry-url writes an .npmrc containing ${NODE_AUTH_TOKEN}. Publishing goes through OIDC trusted publishing, so no such token exists, and yarn v1 aborts rather than expanding an env var that is absent: "Failed to replace env in config". Defining it as empty is enough for yarn's expansion to succeed. npm reads the same empty value as no auth and falls through to trusted publishing, which is what already happens today. Co-Authored-By: Claude Opus 5 --- .github/workflows/publish.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d03cafd..7dbd4eb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -50,6 +50,12 @@ jobs: # Ensure npm 11.5.1 or later is installed - name: Update npm run: npm install -g npm@latest + # setup-node's registry-url writes an .npmrc referencing ${NODE_AUTH_TOKEN}. + # Publishing is done via OIDC, so no such token exists, and yarn v1 aborts + # on an env var it cannot expand. npm itself treats the empty value as no + # auth and falls through to trusted publishing. - run: yarn + env: + NODE_AUTH_TOKEN: '' - run: ./node_modules/.bin/tsc - run: npm publish