|  | 
| 33 | 33 |       - name: Install Dependencies | 
| 34 | 34 |         run: pnpm install | 
| 35 | 35 | 
 | 
| 36 |  | -      - name: Debug | 
| 37 |  | -        continue-on-error: true | 
| 38 |  | -        run: | | 
| 39 |  | -          set -euxo pipefail | 
| 40 |  | -          echo "Node/npm/pnpm versions:" | 
| 41 |  | -          node -v | 
| 42 |  | -          npm -v | 
| 43 |  | -          pnpm -v | 
| 44 |  | -
 | 
| 45 |  | -          echo "\nCurrent npm registry:" | 
| 46 |  | -          npm config get registry || true | 
| 47 |  | -
 | 
| 48 |  | -          echo "\nSanitized npm config (full):" | 
| 49 |  | -          npm config list -l | sed -E 's/(\/\/registry\.npmjs\.org\/:_authToken=).*/\1[REDACTED]/' || true | 
| 50 |  | -
 | 
| 51 |  | -          echo "\nSanitized ~/.npmrc:" | 
| 52 |  | -          if [ -f "$HOME/.npmrc" ]; then sed -E 's/(\/\/registry\.npmjs\.org\/:_authToken=).*/\1[REDACTED]/' "$HOME/.npmrc"; else echo "No ~/.npmrc"; fi | 
| 53 |  | -
 | 
| 54 |  | -          echo "\nSanitized project .npmrc:" | 
| 55 |  | -          if [ -f ".npmrc" ]; then sed -E 's/(\/\/registry\.npmjs\.org\/:_authToken=).*/\1[REDACTED]/' ".npmrc"; else echo "No project .npmrc"; fi | 
| 56 |  | -
 | 
| 57 |  | -          echo "\nRunning prerelease script (non-fatal):" | 
| 58 |  | -          pnpm run prerelease || true | 
| 59 |  | -
 | 
| 60 |  | -          echo "\nRunning npm whoami with verbose logging (non-fatal):" | 
| 61 |  | -          NPM_CONFIG_LOGLEVEL=silly npm whoami || true | 
| 62 |  | -
 | 
| 63 |  | -          echo "\nDry-run npm publish with verbose logging (non-fatal):" | 
| 64 |  | -          NPM_CONFIG_LOGLEVEL=silly npm publish --dry-run || true | 
| 65 |  | -
 | 
| 66 |  | -      - name: Print latest npm debug log if present | 
| 67 |  | -        if: ${{ always() }} | 
| 68 |  | -        continue-on-error: true | 
| 69 |  | -        run: | | 
| 70 |  | -          LOG_DIR="/home/runner/.npm/_logs" | 
| 71 |  | -          echo "Looking for npm logs in $LOG_DIR" | 
| 72 |  | -          ls -al "$LOG_DIR" 2>/dev/null || echo "Log directory not found" | 
| 73 |  | -          latest=$(ls -t "$LOG_DIR"/*.log 2>/dev/null | head -n 1 || true) | 
| 74 |  | -          if [ -n "${latest:-}" ] && [ -f "$latest" ]; then | 
| 75 |  | -            echo "\n=== Showing latest npm debug log: $latest ===" | 
| 76 |  | -            # Redact any accidental token appearances | 
| 77 |  | -            sed -E 's/(\/\/registry\.npmjs\.org\/:_authToken=)[^"\n]+/\1[REDACTED]/g' "$latest" || cat "$latest" | 
| 78 |  | -          else | 
| 79 |  | -            echo "No npm debug logs found" | 
| 80 |  | -          fi | 
| 81 |  | -
 | 
| 82 |  | -      - name: Environment snapshot (sanitized) | 
| 83 |  | -        if: ${{ always() }} | 
| 84 |  | -        continue-on-error: true | 
| 85 |  | -        run: | | 
| 86 |  | -          echo "Relevant environment variables:" | 
| 87 |  | -          env | sort | grep -E '^(CI=|GITHUB_|NODE_|NPM_|PNPM_)' || true | 
| 88 |  | -
 | 
| 89 | 36 |       - name: Create Release Pull Request or Publish to npm | 
| 90 | 37 |         id: changesets | 
| 91 | 38 |         uses: changesets/action@v1 | 
|  | 
0 commit comments