diff --git a/.github/actions/javascript/awaitStagingDeploys/index.js b/.github/actions/javascript/awaitStagingDeploys/index.js index 4238fd7bd689..1cb7934cfb91 100644 --- a/.github/actions/javascript/awaitStagingDeploys/index.js +++ b/.github/actions/javascript/awaitStagingDeploys/index.js @@ -12754,12 +12754,13 @@ function promiseDoWhile(condition, action) { console.info('[promiseWhile] promiseDoWhile() condition', condition); const actionResult = action?.(); console.info('[promiseWhile] promiseDoWhile() actionResult', actionResult); - if (actionResult === undefined) { + if (!actionResult) { resolve(); + return; } actionResult - ?.then(() => promiseWhile(condition, action)) - .then(() => resolve()) + .then(() => promiseWhile(condition, action)) + .then(resolve) .catch(reject); }); } diff --git a/.github/libs/promiseWhile.ts b/.github/libs/promiseWhile.ts index ab936eb48648..2fc53c34fec3 100644 --- a/.github/libs/promiseWhile.ts +++ b/.github/libs/promiseWhile.ts @@ -30,14 +30,14 @@ function promiseDoWhile(condition: () => boolean, action: (() => Promise) console.info('[promiseWhile] promiseDoWhile() condition', condition); const actionResult = action?.(); console.info('[promiseWhile] promiseDoWhile() actionResult', actionResult); - - if (actionResult === undefined) { + if (!actionResult) { resolve(); + return; } actionResult - ?.then(() => promiseWhile(condition, action)) - .then(() => resolve()) + .then(() => promiseWhile(condition, action)) + .then(resolve) .catch(reject); }); }