From a34d73ed33d5d5a63e7f2f57166749d3868a6070 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 28 Feb 2025 10:46:05 +0100 Subject: [PATCH] skip task not finished error when taskWaitUntilStopped is true --- dist/index.js | 8 ++++++-- index.js | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 0455d07..647d802 100644 --- a/dist/index.js +++ b/dist/index.js @@ -56621,6 +56621,7 @@ const main = async () => { })); await handleCWResponseAsync(response); + core.debug(`LogGroupARN finished.`); } catch (err) { core.error(err.message); } @@ -56641,8 +56642,11 @@ const main = async () => { }, {cluster, tasks: [taskArn]}); core.debug(`waitECSTaskResult: ${waitECSTaskResult.state} / ${JSON.stringify(waitECSTaskResult)}`); } catch (error) { - core.setFailed(`Task did not start successfully. Error: ${error.message}.`); - process.exit(1); + // if taskWaitUntilStopped is true, the exit code is validated, and therefore we can skip this step + if (!taskWaitUntilStopped) { + core.setFailed(`Task did not start successfully. Error: ${error.message}.`); + process.exit(1); + } } // If taskWaitUntilStopped is false, we can bail out here because we can not tail logs or have any diff --git a/index.js b/index.js index 3cacc2e..7abc7a7 100644 --- a/index.js +++ b/index.js @@ -157,6 +157,7 @@ const main = async () => { })); await handleCWResponseAsync(response); + core.debug(`LogGroupARN finished.`); } catch (err) { core.error(err.message); } @@ -177,8 +178,11 @@ const main = async () => { }, {cluster, tasks: [taskArn]}); core.debug(`waitECSTaskResult: ${waitECSTaskResult.state} / ${JSON.stringify(waitECSTaskResult)}`); } catch (error) { - core.setFailed(`Task did not start successfully. Error: ${error.message}.`); - process.exit(1); + // if taskWaitUntilStopped is true, the exit code is validated, and therefore we can skip this step + if (!taskWaitUntilStopped) { + core.setFailed(`Task did not start successfully. Error: ${error.message}.`); + process.exit(1); + } } // If taskWaitUntilStopped is false, we can bail out here because we can not tail logs or have any