actions / actions/runner

Reusable workflow input with default string is not used when the calling input passed an empty string.

Open
#2,907 6 comments 17 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

Describe the bug
Reusable workflow input (string) with default is not used when the calling input passed an empty string.
To Reproduce
Steps to reproduce the behavior:

  1. reusable workflow
name: 'reusable_workflow'
on:
  workflow_call:
    inputs:
      message:
        description: 'message.'
        type: 'string'
        default: 'default message'
        required: false
jobs:
  print-inputs:
    runs-on: ubuntu-latest
    steps:
      - name: job summary
        run: |
          echo "message: ${{ inputs.message }}" >> $GITHUB_STEP_SUMMARY

  1. create a caller workflow that calls 1
name: 'caller'
on:
  workflow_dispatch:
    inputs:
      message:
        description: 'message'
        type: 'string'
        required: false
jobs:
  call-reusable-workflow:
    uses: '.../reusable-workflow.yml@main'
    with:
      message: ${{ inputs.message }}
  1. trigger the caller workflow without providing a message input

Expected behavior
should print message: default message

Job Log Output

But print message:

Runner Version and Platform

Version of your runner?

ubuntu-latest

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior with the reusable workflow and caller workflow shown in the issue, using an omitted or empty message input. Trace how the runner handles workflow_call string defaults, then verify that the job summary prints "message: default message" when the caller provides no message.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, github-actions
Domain
ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.