Skip to content

Commit db9484f

Browse files
committed
fix(release): keep waiting while a stable tag's CI run is requested or not created yet
1 parent 8f37edb commit db9484f

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎scripts/release-plan.mjs‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,21 @@ async function ciConclusion(env, sha) {
127127
return isVersionOnlyCommit(commit) ? ciConclusion(env, commit.parents[0].sha) : 'missing';
128128
}
129129

130+
// `missing` included: a tag pushed right after a merge can arrive before the merge's CI run exists.
131+
const UNSETTLED_CI = new Set([
132+
'missing',
133+
'requested',
134+
'queued',
135+
'waiting',
136+
'pending',
137+
'in_progress',
138+
]);
139+
130140
/** A tag pushed right after a merge waits, within the Plan job's budget, for that merge's CI. */
131141
async function settledCiConclusion(env, sha) {
132142
for (let attempt = 0; ; attempt += 1) {
133143
const conclusion = await ciConclusion(env, sha);
134-
if (!['queued', 'in_progress', 'waiting', 'pending'].includes(conclusion) || attempt >= 40) {
144+
if (!UNSETTLED_CI.has(conclusion) || attempt >= 40) {
135145
return conclusion;
136146
}
137147
await new Promise((resolve) => setTimeout(resolve, 30_000));

0 commit comments

Comments
 (0)