diff --git a/.github/actions/javascript/awaitStagingDeploys/index.js b/.github/actions/javascript/awaitStagingDeploys/index.js index 1cb7934cfb91..d84c6df1a0d3 100644 --- a/.github/actions/javascript/awaitStagingDeploys/index.js +++ b/.github/actions/javascript/awaitStagingDeploys/index.js @@ -12738,6 +12738,10 @@ function promiseWhile(condition, action) { else { const actionResult = action?.(); console.info('[promiseWhile] promiseWhile() actionResult', actionResult); + if (!actionResult) { + resolve(); + return; + } Promise.resolve(actionResult).then(loop).catch(reject); } }; diff --git a/.github/libs/promiseWhile.ts b/.github/libs/promiseWhile.ts index 2fc53c34fec3..01c061096d64 100644 --- a/.github/libs/promiseWhile.ts +++ b/.github/libs/promiseWhile.ts @@ -13,6 +13,12 @@ function promiseWhile(condition: () => boolean, action: (() => Promise) | } else { const actionResult = action?.(); console.info('[promiseWhile] promiseWhile() actionResult', actionResult); + + if (!actionResult) { + resolve(); + return; + } + Promise.resolve(actionResult).then(loop).catch(reject); } };