From c8f5b605983332fb8bfc8cf39c80cba6123456a7 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Tue, 10 Mar 2026 03:57:58 -0600 Subject: [PATCH] fix(publish): remove empty token env and improve auth diagnostics --- .github/workflows/publish.yaml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 8737304df..aac350b4e 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -79,7 +79,15 @@ jobs: echo " actor: ${{ github.actor }}" echo " selected_channel: ${{ inputs.channel || 'n/a' }}" echo " selected_bump: ${{ inputs.bump || 'n/a' }}" - echo " node_auth_token_present: $([ -n \"$NODE_AUTH_TOKEN\" ] && echo yes || echo no)" + if [ "${NODE_AUTH_TOKEN+x}" = "x" ]; then + if [ -n "$NODE_AUTH_TOKEN" ]; then + echo " node_auth_token_state: set-nonempty" + else + echo " node_auth_token_state: set-empty" + fi + else + echo " node_auth_token_state: unset" + fi WORKFLOW_FILE=$(node -e " const ref = process.argv[1] || ''; @@ -174,16 +182,10 @@ jobs: - name: Publish prerelease to npm if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.channel == 'next') run: npm publish --tag next --provenance - env: - NPM_CONFIG_USERCONFIG: /dev/null - NODE_AUTH_TOKEN: "" - name: Publish stable release to npm if: github.event_name == 'workflow_dispatch' && inputs.channel == 'latest' run: npm publish --tag latest --provenance - env: - NPM_CONFIG_USERCONFIG: /dev/null - NODE_AUTH_TOKEN: "" - name: Print npm debug logs if: always()