From 1ed5c9d94b4a6585a3d710064c26491fb8ce9df7 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Tue, 10 Mar 2026 02:42:49 -0600 Subject: [PATCH] fix: force trusted publish without token auth (#1885) * fix: force trusted publish without token auth * chore: always print npm debug logs --- .github/workflows/publish.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 9334743d3..03f972823 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -65,6 +65,7 @@ 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)" WORKFLOW_FILE=$(node -e " const ref = process.argv[1] || ''; @@ -159,10 +160,34 @@ 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: + 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: + NODE_AUTH_TOKEN: "" + + - name: Print npm debug logs + if: always() + run: | + LOG_DIR="$HOME/.npm/_logs" + echo "npm log directory: $LOG_DIR" + ls -la "$LOG_DIR" || true + + found=0 + for file in "$LOG_DIR"/*-debug-0.log; do + [ -e "$file" ] || continue + found=1 + echo "::group::npm-debug $(basename "$file")" + cat "$file" + echo "::endgroup::" + done + + if [ "$found" -eq 0 ]; then + echo "No npm *-debug-0.log files found." + fi - name: Push version commit and tag if: github.event_name == 'workflow_dispatch' && inputs.channel == 'latest'