From c224188dd3a80fcd13e2f38b6aa03ea06f0ea895 Mon Sep 17 00:00:00 2001 From: weishu Date: Thu, 25 Dec 2025 12:46:26 +0800 Subject: [PATCH] chore: allow release dry-run without npm login --- cli/scripts/release-all.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/cli/scripts/release-all.ts b/cli/scripts/release-all.ts index 81eabb98..4ff248c3 100644 --- a/cli/scripts/release-all.ts +++ b/cli/scripts/release-all.ts @@ -54,13 +54,17 @@ async function main(): Promise { } console.log(' ✓ On main branch'); - // Pre-check: Ensure npm is logged in - try { - const npmUser = execSync('npm whoami', { encoding: 'utf-8' }).trim(); - console.log(` ✓ Logged in to npm as: ${npmUser}`); - } catch { - console.error('❌ Not logged in to npm. Run `npm login` first.'); - process.exit(1); + // Pre-check: Ensure npm is logged in (skip in dry-run mode) + if (!dryRun) { + try { + const npmUser = execSync('npm whoami', { encoding: 'utf-8' }).trim(); + console.log(` ✓ Logged in to npm as: ${npmUser}`); + } catch { + console.error('❌ Not logged in to npm. Run `npm login` first.'); + process.exit(1); + } + } else { + console.log(' ✓ Skipping npm login check (dry-run)'); } // Step 1: Update package.json version