From 5b71825ce3eb154190c9c10f4678d38f08af95bf Mon Sep 17 00:00:00 2001 From: DrSmoothl <1787882683@qq.com> Date: Tue, 15 Sep 2026 16:22:05 +0800 Subject: [PATCH] chore(tooling): wait for the version bump commit, not the current tip A later tooling commit on dev made the waiter look for a SHA that main will never match. Tag the chore(release) commit itself. --- tools/release.mjs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/release.mjs b/tools/release.mjs index 65e6f581..53a712e4 100644 --- a/tools/release.mjs +++ b/tools/release.mjs @@ -126,6 +126,16 @@ function headIsThisRelease() { return headSubject() === releaseCommit && packageVersion() === version; } +/** The bump commit for this version, even if later tooling commits sit on top. */ +function thisReleaseSha() { + try { + const sha = shCapture(`git log -1 --format=%H --grep=${JSON.stringify(`^${releaseCommit}$`)}`); + return sha || null; + } catch { + return null; + } +} + function shCapture(cmd) { return execSync(cmd, { cwd: repoRoot, encoding: 'utf-8' }).trim(); } @@ -353,7 +363,9 @@ async function waitUntilMainIs(expectedSha) { } async function waitAndTag() { - const expectedSha = dryRun ? 'dry-run' : shCapture('git rev-parse dev'); + const expectedSha = dryRun + ? 'dry-run' + : (thisReleaseSha() || shCapture('git rev-parse dev')); if (dryRun) { info(`would wait until origin/main equals dev @ ${expectedSha.slice(0, 12)}`);