runner icon indicating copy to clipboard operation
runner copied to clipboard

Boolean inputs to workflow_call can't be used in scripts

Open FalconerTC opened this issue 2 years ago • 1 comments

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 }}
image

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

FalconerTC avatar Sep 06 '23 10:09 FalconerTC

+1 also experiencing this, is there any workaround?

ssyberg avatar Dec 07 '23 16:12 ssyberg