Skip to content

Unable to use `boolean` input for a YAML bool

Situation

I want to be able to define an input of type boolean and interpolate that somewhere that requires an actual YAML bool.

For example:

spec:
  inputs:
    allow_failure:
      default: true
      type: boolean

---

example:
  image: alpine
  script: false
  allow_failure: $[[ inputs.allow_failure ]]

When including this component it will fail with: jobs:example allow failure should be a hash or a boolean value:

include:
  - component: ...
    inputs: []

Questions

  1. Is it somehow possible to make it above work today?
  2. What are input types actually used for? To validate the user inputs?