Boolean inputs act differently in workflow_dispatch and workflow_call #9343
-
Hello, It seems like boolean inputs act as strings when used in a workflow_dispatch event, and as actual boolean variables when used in a reusable workflow (workflow_call). For example, in one of my workflows, which acts on a workflow_dispatch event I use a boolean input "should_run_tests", which controls the tests step using an if condition on the step. And not as you would expect from a boolean: It seems like the boolean type affects only the input form because I can see a checkbox when trying to run the workflow, but the value passed to the workflow is the string representation "true" or "false". Doing the same thing in a workflow_call event, the boolean values that are being passed from one workflow to the other really seem to be booleans, and can be tested as such without string comparison, which I think is the right way to handle these and that should be the same in workflow_dispatch events |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Thanks @AvivPeledTalon - I agree that this difference is a bit confusing. The reason is because when The team is taking a look at some ways that we can improve this without breaking workflows that rely on it. Hopefully we'll have more soon! |
Beta Was this translation helpful? Give feedback.
-
@AvivPeledTalon We have rolled out improvements and here is the blog post Now we should be able to see dispatch inputs are available in both |
Beta Was this translation helpful? Give feedback.
-
hi @ajaykn , I'm actually trying to debug something similar where this is not working quite right. I have a workflow that is callable from either workflow_call or workflow_dispatch. As mentioned I have a lot of fields where I do ${{ github.event.inputs.environment || inputs.environment }} to make sure that the inputs work from either the manual call or call from another workflow. However, one step in my action, where it's I have this condition |
Beta Was this translation helpful? Give feedback.
-
see also actions/runner#3571 |
Beta Was this translation helpful? Give feedback.
@AvivPeledTalon We have rolled out improvements and here is the blog post
https://github.blog/changelog/2022-06-10-github-actions-inputs-unified-across-manual-and-reusable-workflows/
Now we should be able to see dispatch inputs are available in both
github.event.inputs
andinputs
context.Where as now inputs context is recommended to use, because we respect boolean types.
cc @chrispat @avocaddo