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.
This commit is contained in:
1 file changed
+13
-1
+13
-1
@@ -126,6 +126,16 @@ function headIsThisRelease() {
|
|||||||
return headSubject() === releaseCommit && packageVersion() === version;
|
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) {
|
function shCapture(cmd) {
|
||||||
return execSync(cmd, { cwd: repoRoot, encoding: 'utf-8' }).trim();
|
return execSync(cmd, { cwd: repoRoot, encoding: 'utf-8' }).trim();
|
||||||
}
|
}
|
||||||
@@ -353,7 +363,9 @@ async function waitUntilMainIs(expectedSha) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function waitAndTag() {
|
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) {
|
if (dryRun) {
|
||||||
info(`would wait until origin/main equals dev @ ${expectedSha.slice(0, 12)}`);
|
info(`would wait until origin/main equals dev @ ${expectedSha.slice(0, 12)}`);
|
||||||
|
|||||||
Reference in new issue
Block a user