Skip to content

Commit 7506447

Browse files
authored
chore: debug release script (sveltejs#1348)
1 parent a51c742 commit 7506447

File tree

1 file changed

+50
-3
lines changed

1 file changed

+50
-3
lines changed

.github/workflows/Release.yml

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,57 @@ jobs:
3333
run: pnpm install
3434

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

0 commit comments

Comments
 (0)