From: Evan You Date: Tue, 6 Aug 2024 13:07:54 +0000 (+0800) Subject: workflow: bail release when skipping prompts + CI not passed yet X-Git-Tag: v3.4.36~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae09d24f41c3612f972caf5ba3b01c782321f089;p=thirdparty%2Fvuejs%2Fcore.git workflow: bail release when skipping prompts + CI not passed yet --- diff --git a/scripts/release.js b/scripts/release.js index 82ecf9f990..9df761f2e3 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -252,15 +252,23 @@ async function main() { let isCIPassed = await getCIResult() skipTests ||= isCIPassed - if (isCIPassed && !skipPrompts) { - /** @type {{ yes: boolean }} */ - const { yes: promptSkipTests } = await prompt({ - type: 'confirm', - name: 'yes', - message: `CI for this commit passed. Skip local tests?`, - }) - - skipTests = promptSkipTests + if (isCIPassed) { + if (!skipPrompts) { + /** @type {{ yes: boolean }} */ + const { yes: promptSkipTests } = await prompt({ + type: 'confirm', + name: 'yes', + message: `CI for this commit passed. Skip local tests?`, + }) + skipTests = promptSkipTests + } else { + skipTests = true + } + } else if (skipPrompts) { + throw new Error( + 'CI for the latest commit has not passed yet. ' + + 'Only run the release workflow after the CI has passed.', + ) } }