Open sqin2019 opened 1 year ago
I am experiencing the same issue. Are there any updates on this?
I searched for the documentation online of the inputs default values. But i'm sorry, i can not find them. In VSCode and the Github Actions extension installed, i will see this as documentation for the default values of the different types of inputs:
If a default parameter is not set, the default value of the input is false for boolean, 0 for a number, and "" for a string.
So your workflow call (named: "caller") will pass an empty string to the reusable workflow (named: "reusable_workflow") and that's why the output is empty.
HTH Alex
Same :)
If a default parameter is not set, the default value of the input is false for boolean, 0 for a number, and "" for a string.
That does seem to be how it is currently working. But it doesn't make sense because it removes the whole reason for using default values? Must be a bug?
Works if you move default handling from called to caller. can then remove default from called and set required to true. Idk.
Default values are not working for me in the caller/called workflow setting. A year later, this feature still does not work!
Works if you move default handling from called to caller. can then remove default from called and set required to true
I would recommend using this solution. When changing the handling to your expected/suggested behavior. They will probably break a lot of other workflows that has a default value but have also the option to supress this by passing an empty string.
Moving the default to a proper place (where user inputs are possible and optional) is in my opinion the better way to solve this.
I ran into the same problem, thats why i found this issue. But after thinking about, how it works and what i tried to do, i saw that my first approach was simply not correct, because an empty string is an empty string and not nothing/NULL/void/undefined.
JM2C βΊοΈ
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:
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 }}