Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: forceNewDeployment to be a boolean #140

Merged
merged 3 commits into from
Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.toLowerCase === 'true' || forceNewDeployInput);

// Register the task definition
core.debug('Registering the task definition');
const taskDefPath = path.isAbsolute(taskDefinitionFile) ?
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.toLowerCase === 'true' || forceNewDeployInput);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why you're adding the || forceNewDeployInput as a condition here?

Copy link
Contributor Author

@paragbhingre paragbhingre Nov 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forceNewDeployInput was coming as a string which was the main issue that we solved with the following condition forceNewDeployInput != undefined && forceNewDeployInput.toLowerCase === 'true' but the test case sends an actual boolean value which was not taken care by the above condition.
Now, we have added extra condition of || forceNewDeployInput that takes care of the boolean value of the forceNewDeploy as well.
How does that sound to you @piradeepk ?


// Register the task definition
core.debug('Registering the task definition');
const taskDefPath = path.isAbsolute(taskDefinitionFile) ?
Expand Down