Unable to trigger conditional workflow with boolean value

I’m using a version 2.1 config file, and v2 API to conditionally trigger a workflow. However, the true or false value in the body of my POST is always evaluated as a string instead of a boolean by CircleCi’s API.

In the below example, I did not send true in quotes.

Is this a bug?

#!/bin/sh -eo pipefail
# Error calling workflow: 'cicd_plan_infra'
# Type error for argument plan_infra: expected type: boolean, actual value: \"true\" (type string)
# 
# -------
# Warning: This configuration was auto-generated to show you the message above.
# Don't rerun this job. Rerunning will have no effect.
false

Exited with code 1

config.yml applicable lines:

version: 2.1
parameters:
  plan_infra:
    type: boolean
    default: false

workflows:
  version: 2
  cicd_plan_infra:
    when: << pipeline.parameters.plan_infra >>
    jobs:
      - build
      - plan_infra:
          context: << pipeline.parameters.customer_aws_auth >>
          requires:
            - build

solved by using application/json Content-Type and body with:

{
"branch": "multi_customer",
"parameters": {
		        "plan_infra": true
    }
}

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.