From b56ca30fcddd80c59824da33c8557a49854cf5bd Mon Sep 17 00:00:00 2001 From: Abdul Wahab Date: Wed, 12 Aug 2026 20:45:48 +0500 Subject: [PATCH] Restore dry-run guard around the release build step The picker staleness check added on this branch had replaced main's dry-run branch, so `--dry-run` executed the real build. Keep the picker hash check but only on a real run, matching main's dry-run contract. AI-assisted (agent-implemented, maintainer-directed). Co-authored-by: Cursor --- scripts/release.mjs | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/scripts/release.mjs b/scripts/release.mjs index b5aca12c6..e4374de80 100755 --- a/scripts/release.mjs +++ b/scripts/release.mjs @@ -131,19 +131,23 @@ ok('clean'); if (cfg.buildCmd) { step(`Rebuilding outputs (${cfg.buildCmd})`); - const pickerOutput = component === 'skill' - ? path.join(repoRoot, 'skill/scripts/picker') - : null; - const pickerHashBefore = pickerOutput ? directoryHash(pickerOutput) : null; - execSync(cfg.buildCmd, { cwd: repoRoot, stdio: 'inherit' }); - if (pickerHashBefore && directoryHash(pickerOutput) !== pickerHashBefore) { - fail(`Picker build output was stale. Run \`bun run build:picker\`, then re-run the release check.`); + if (dryRun) { + console.log(` [dry-run] ${cfg.buildCmd}`); + } else { + const pickerOutput = component === 'skill' + ? path.join(repoRoot, 'skill/scripts/picker') + : null; + const pickerHashBefore = pickerOutput ? directoryHash(pickerOutput) : null; + execSync(cfg.buildCmd, { cwd: repoRoot, stdio: 'inherit' }); + if (pickerHashBefore && directoryHash(pickerOutput) !== pickerHashBefore) { + fail(`Picker build output was stale. Run \`bun run build:picker\`, then re-run the release check.`); + } + const postBuild = run('git status --porcelain'); + if (postBuild) { + fail(`Build produced uncommitted changes. Run \`${cfg.buildCmd}\`, commit the result, then re-run.\n${postBuild}`); + } + ok('build outputs match source'); } - const postBuild = run('git status --porcelain'); - if (postBuild) { - fail(`Build produced uncommitted changes. Run \`${cfg.buildCmd}\`, commit the result, then re-run.\n${postBuild}`); - } - ok('build outputs match source'); } step('Checking HEAD is pushed to origin');