From de201af8db0717cd5b09973cacdfcad29a6c674b Mon Sep 17 00:00:00 2001 From: Parag Bhingre Date: Tue, 10 Nov 2020 09:46:19 -0800 Subject: [PATCH 1/2] fix: forceNewDeployment to be a boolean --- dist/index.js | 4 +++- index.js | 4 +++- index.test.js | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index 6cde89c60..0934907dc 100644 --- a/dist/index.js +++ b/dist/index.js @@ -355,8 +355,10 @@ async function run() { if (waitForMinutes > MAX_WAIT_MINUTES) { waitForMinutes = MAX_WAIT_MINUTES; } - const forceNewDeployment = core.getInput('force-new-deployment', { required: false }) || false; + const forceNewDeployInput = core.getInput('force-new-deployment', { required: false }) + const forceNewDeployment = forceNewDeployInput != undefined && forceNewDeployInput.toLocaleLowerCase === "true" ? true : false; + // Register the task definition core.debug('Registering the task definition'); const taskDefPath = path.isAbsolute(taskDefinitionFile) ? diff --git a/index.js b/index.js index dc9b2fef8..50662f711 100644 --- a/index.js +++ b/index.js @@ -222,8 +222,10 @@ async function run() { if (waitForMinutes > MAX_WAIT_MINUTES) { waitForMinutes = MAX_WAIT_MINUTES; } - const forceNewDeployment = core.getInput('force-new-deployment', { required: false }) || false; + const forceNewDeployInput = core.getInput('force-new-deployment', { required: false }) + const forceNewDeployment = forceNewDeployInput != undefined && forceNewDeployInput.toLocaleLowerCase === "true" ? true : false; + // Register the task definition core.debug('Registering the task definition'); const taskDefPath = path.isAbsolute(taskDefinitionFile) ? diff --git a/index.test.js b/index.test.js index a76f55d6e..3432ed124 100644 --- a/index.test.js +++ b/index.test.js @@ -755,7 +755,7 @@ describe('Deploy to ECS', () => { cluster: 'cluster-789', service: 'service-456', taskDefinition: 'task:def:arn', - forceNewDeployment: true + forceNewDeployment: false }); }); From f2753f22204273512c721137ebf82c537e6b4fd9 Mon Sep 17 00:00:00 2001 From: Parag Bhingre Date: Wed, 11 Nov 2020 16:02:15 -0800 Subject: [PATCH 2/2] Implementation of review comments --- 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 0934907dc..8f3b97b61 100644 --- a/dist/index.js +++ b/dist/index.js @@ -356,8 +356,8 @@ async function run() { waitForMinutes = MAX_WAIT_MINUTES; } - const forceNewDeployInput = core.getInput('force-new-deployment', { required: false }) - const forceNewDeployment = forceNewDeployInput != undefined && forceNewDeployInput.toLocaleLowerCase === "true" ? true : false; + const forceNewDeployInput = core.getInput('force-new-deployment', { required: false }); + const forceNewDeployment = forceNewDeployInput != undefined && (forceNewDeployInput.toLowerCase === 'true' || forceNewDeployInput); // Register the task definition core.debug('Registering the task definition'); diff --git a/index.js b/index.js index 50662f711..c0f49f74d 100644 --- a/index.js +++ b/index.js @@ -223,8 +223,8 @@ async function run() { waitForMinutes = MAX_WAIT_MINUTES; } - const forceNewDeployInput = core.getInput('force-new-deployment', { required: false }) - const forceNewDeployment = forceNewDeployInput != undefined && forceNewDeployInput.toLocaleLowerCase === "true" ? true : false; + const forceNewDeployInput = core.getInput('force-new-deployment', { required: false }); + const forceNewDeployment = forceNewDeployInput != undefined && (forceNewDeployInput.toLowerCase === 'true' || forceNewDeployInput); // Register the task definition core.debug('Registering the task definition'); diff --git a/index.test.js b/index.test.js index 3432ed124..a76f55d6e 100644 --- a/index.test.js +++ b/index.test.js @@ -755,7 +755,7 @@ describe('Deploy to ECS', () => { cluster: 'cluster-789', service: 'service-456', taskDefinition: 'task:def:arn', - forceNewDeployment: false + forceNewDeployment: true }); });