Skip to content

Commit

Permalink
fix: Force parameter not added for keep === 0
Browse files Browse the repository at this point in the history
The comparison to check if the force parameter should be supplied used
the string based input argument and not the parsed number when comparing
with the number 0. Thus force would always be false, even for those
cases where keep === 0.

This is now fixed. However, the bug highlights the need to port the
project to TypeScript to more easily catch these bugs.

Signed-off-by: Snorre Magnus Davøen <snorre.magnus.davoen@adventuretech.no>
  • Loading branch information
snorremd committed Jan 20, 2023
1 parent 33716c8 commit b8277e0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const main = async ({ project, account, branch, since, token, deploymentTriggerT
let deleted = 0
for (let i = 0; i < branchDeployments.length; i++) {
try {
await deleteDeployment(project, account, token, keep === 0, branchDeployments[i])
await deleteDeployment(project, account, token, keepNumber === 0, branchDeployments[i])
deleted = deleted + 1
core.info(`🟢 Deleted deployment ${branchDeployments[i].id}`)
} catch (e) {
Expand Down

0 comments on commit b8277e0

Please sign in to comment.