runner
runner copied to clipboard
Boolean inputs to workflow_call can't be used in scripts
Describe the bug
When a boolean input is presented to a workflow_call workflow, it can't be used inside a run. Attempting to do so gives the error Invalid type found: string was expected but boolean was found.
name: Test workflow
on:
workflow_call:
inputs:
some_bool:
type: boolean
default: false
jobs:
test-workflow:
runs-on: ubuntu-latest
name: test-workflow
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Test boolean
run: echo ${{ inputs.some_bool }}
If executed, it will never echo anything. One way to fix this is to use an env instead
name: Test workflow
on:
workflow_call:
inputs:
some_bool:
type: boolean
default: false
jobs:
test-workflow:
runs-on: ubuntu-latest
name: test-workflow
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Test boolean
env:
some_bool: ${{ inputs.some_bool }}
run: echo ${{ env.some_bool }}
This seems like strange behavior. I haven't found any way to use a boolean in a script with workflow_call. I also don't see this in the docs regarding workflow_call
Runner Version and Platform
ubuntu-latest
Related issues
https://github.com/actions/runner/issues/1483 https://github.com/orgs/community/discussions/11391
+1 also experiencing this, is there any workaround?