nrwl / nx-orb

✨ A CircleCI Orb which includes helpful commands for running Nx commands in the CI
https://github.com/nrwl/nx-orb
MIT License
20 stars 25 forks source link

fix: check for allow-on-hold-workflow param as it will have value 0 o… #22

Closed abaran30 closed 2 years ago

abaran30 commented 2 years ago

…r 1 in the script.

This pull request fixes a bug with the new param allow-on-hold-workflow. Because it is a boolean, in the script, it will have a value of '0' or '1'.

I did a simple test in a personal CircleCI workflow and verified param setting with the following:

async function isWorkflowSuccessful(pipelineId, workflowName) {
  if (allowOnHoldWorkflow === '1') {
    console.log('Successfully set.');
  }
...

@meeroslav, question, I see that the script contains conditional if (errorOnNoSuccessfulWorkflow === 'true') {; has this been verified to work? I followed this example when creating allowOnHoldWorkflow as these two params are booleans. Let me know if we should change the errorOnNoSuccessfulWorkflow conditional to check if === '1'.

abaran30 commented 2 years ago

@meeroslav let us know what you think!

meeroslav commented 2 years ago

Hi @adbaran1, thank you for reporting the issue and proposing the fix. And sorry for the delay in responding.

You are right, both errorOnNoSuccessfulWorkflow and allowOnHoldWorkflow are handled incorrectly.