From 4b6d44541b0b3e5871a0eb4265d8c35a35cbb215 Mon Sep 17 00:00:00 2001 From: yehudacohen <37450100+yehudacohen@users.noreply.github.com> Date: Thu, 28 Jan 2021 13:23:55 -0500 Subject: [PATCH] fix: enable forceNewDeployment for ECS Task that is broken per #157 (#159) Co-authored-by: yehuda-elementryx <37450100+yehuda-elementryx@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- dist/index.js | 4 ++-- index.js | 4 ++-- index.test.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/index.js b/dist/index.js index 1192f3807..6ffd36d5c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -391,8 +391,8 @@ async function run() { waitForMinutes = MAX_WAIT_MINUTES; } - const forceNewDeployInput = core.getInput('force-new-deployment', { required: false }) || false; - const forceNewDeployment = forceNewDeployInput != undefined && (forceNewDeployInput.toLowerCase === 'true' || forceNewDeployInput); + const forceNewDeployInput = core.getInput('force-new-deployment', { required: false }) || 'false'; + const forceNewDeployment = forceNewDeployInput.toLowerCase() === 'true'; // Register the task definition core.debug('Registering the task definition'); diff --git a/index.js b/index.js index fa87eb061..dcf84c7a1 100644 --- a/index.js +++ b/index.js @@ -226,8 +226,8 @@ async function run() { waitForMinutes = MAX_WAIT_MINUTES; } - const forceNewDeployInput = core.getInput('force-new-deployment', { required: false }) || false; - const forceNewDeployment = forceNewDeployInput != undefined && (forceNewDeployInput.toLowerCase === 'true' || forceNewDeployInput); + const forceNewDeployInput = core.getInput('force-new-deployment', { required: false }) || 'false'; + const forceNewDeployment = forceNewDeployInput.toLowerCase() === 'true'; // Register the task definition core.debug('Registering the task definition'); diff --git a/index.test.js b/index.test.js index 4a7d768cb..7ec0691aa 100644 --- a/index.test.js +++ b/index.test.js @@ -741,7 +741,7 @@ describe('Deploy to ECS', () => { .mockReturnValueOnce('cluster-789') // cluster .mockReturnValueOnce('false') // wait-for-service-stability .mockReturnValueOnce('') // wait-for-minutes - .mockReturnValueOnce(true); // force-new-deployment + .mockReturnValueOnce('true'); // force-new-deployment await run(); expect(core.setFailed).toHaveBeenCalledTimes(0);