From a34d73ed33d5d5a63e7f2f57166749d3868a6070 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 28 Feb 2025 10:46:05 +0100 Subject: [PATCH 1/2] 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 From e8822419895de7bcc6068e38b85c958429bc6c35 Mon Sep 17 00:00:00 2001 From: Simon Tretter Date: Fri, 28 Feb 2025 10:49:37 +0100 Subject: [PATCH 2/2] Update package.json --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4fc0c8a..ba177d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "@simllll/github-action-aws-ecs-run-task", - "version": "1.4.10", + "name": "github-action-aws-ecs-run-task", + "version": "1.5.0", "description": "Run an AWS ECS Fargate task.", "main": "index.js", "scripts": {