Composite actions input types (boolean/numeric)

I would like to pass boolean and numeric types to composite actions. It appears that only string inputs are currently supported for composite actions.

Is that correct? Is there a way to work around this limitation? Are there any plans to implement types into composite action inputs?

This is currently supported with reusable workflows that have a similar input syntax. Syntax for composite actions would look something like this:

name: say-hello
description: Steps to say hello

inputs:
  should_say_hello:
    description: Whether to print hello
    type: boolean
    required: true
    default: true

runs:
  using: "composite"
  steps:
    - name: Say hello
      shell: bash
      run: |
        echo Hello
      if: inputs.should_say_hello
2 Likes

The toJSON() and fromJSON() functions might help: Turn your data into JSON in the workflow, and back to the structure in the composite action.

2 Likes

This is a great workaround!

I’m still interested in seeing inputs types on composite actions to have feature parity with reusable workflow configuration, but this definitely unblocks my scenario. Thank you!

2 Likes