Skip to content

Input of type number are not forwarded by 'workflow_dispatch' to the reused workflow #2848

Description

@kunalherkal

Describe the bug
When a workflow_dispatch calls a reusable workflow, the input of type number causes the workflow run to fail.

To Reproduce
This is the reusable workflow that is called:

name: Called workflow

on:
  workflow_call:
    inputs:
      inputA:
        description: Number input
        required: true
        type: number
      inputB:
        description: String input
        required: true
        type: string

jobs:
  print_hello_world:
    runs-on: ubuntu-latest
    steps:
      - name: Print inputs
        run: echo "Hello world"

This is the caller workflow that calls above workflow:

name: Caller Workflow

on:
  workflow_dispatch:
    inputs:
      inputA:
        description: Number input
        required: true
        type: number
      inputB:
        description: String input
        required: true
        type: string

jobs:
  call_reusable_workflow:
    uses: ./.github/workflows/called-workflow.yml
    with:
      inputA: ${{ inputs.inputA }}
      inputB: ${{ inputs.inputB }}

Error:
When triggering the workflow_dispatch using UI, I pass 123 as value for inputA and some string for inputB.
The job doesn't even start and I see following error:

Caller Dispatch Workflow: .github#L1
The template is not valid. .github/workflows/caller-workflow.yml (Line: 19, Col: 15): Unexpected value '123'

Also if I hardcode inputA when calling the called workflow, run succeeds. for example:

jobs:
  call_reusable_workflow:
    uses: ./.github/workflows/called-workflow.yml
    with:
      inputA: 1000
      inputB: ${{ inputs.inputB }}

Expected behavior
Workflow run should not fail when a number input is used in workflow_dispatch that calls a reusable workflow with same number input.

Runner Version and Platform

Version of your runner?
Github Hosted: '2.309.0'

OS of the machine running the runner? OSX/Windows/Linux/...

Ubuntu
  22.04.3
  LTS

What's not working?

Please include error messages and screenshots.

Job Log Output

The job does not even start, it just shows The template is not valid. and doesn't run anything.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions