You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Boolean inputs are not actually booleans in composite actions #2238
Fun fact this composite action will also use the type string for myobjinput, because the type property is not parsed / supported in composite actions yet. Just the parser is instructed to be relaxed to not throw an error if you invent your own properties, I think you can add anything under an input yaml mapping.
Action Inputs are still saved in a Dictionary<string, string>, which cannot even store a true boolean, I'm not affiliated with GitHub, only a contributor of one bug fix.
That will always echo realRun==false on the first step and will never run the second step, independent on whether the input value is given as boolean true or false. That is because it seems the realRun input value is treated as string in the composite action.
I know I can get it working by using string 'true' in the expressions above, instead of boolean true, but it will work only as long as this bug with treating boolean inputs as strings in a composite action has been fixed.
I was hoping to do something similiar with the output of a composite action, but there doesn't seem to be any way to force it to be a boolean either. I'm using:
outputs:
image_exists:
description: true if an image with the given exists, false otherwise
value: ${{ fromJSON(steps.verify_image_exists.outputs.image_exists) }}
This shouldn't be surprising given that it is documented but it's still frustrating and you end up with the same "always evaluates to false" problem.
Reacted by Volodymyr Machula, sremp, Dixon Sean Low Yan Feng, Zekun ZHANG and Leho Kraav
The outputs in the composite actions look like this:
on:
workflow_call:
outputs:
build-label-present:
description: "cicd:build label is present in the PR"
value: ${{ contains(github.event.pull_request.labels.*.name, 'cicd:build') }}
deploy-label-present:
description: "cicd:deploy:* label is present in the PR"
value: ${{ contains(toJSON(github.event.pull_request.labels.*.name), 'cicd:deploy:') }}
+1 to this. Just recently ran into this exact issue, with the only reasonable workaround being to use string semantics as detailed in the original post.
Reacted by Andrea Cassioli, Vicente Reyes, Russellsch, Espen Waaga, Martin Bjeldbak Madsen, Generalov Maxim, Kris Miller and arthury-lettuce
Just ran into this issue as well. There doesn't seem to be any related information on the official documentation, and it is very non-intuitive to have inputs support multiple types in workflows and "normal" actions but not in composite actions. I hope this behavior can be changed.
Reacted by Bjørn Wiegell, Dixon Sean Low Yan Feng, Ben Hutton, sremp, Marcos Pereira, Mahmoud Saada and Seth R. Johnson
I wonder how to best work around this though? Turn false into empty strings? Explicitly check == 'true' each time? Wrap in fromJSON()? Or ditch composite actions and use reusable workflows instead, accepting the need to allocate a new runner and transfer/recreate state?
Tentatively I would go with the first option, turning false into empty strings. Let's see how that goes...
Activity
ChristopherHX commentedon Nov 2, 2022
Would be nice to have non string inputs in composite actions, especially the object type would be great in my opinion
Fun fact this composite action will also use the type string for myobjinput, because the
typeproperty is not parsed / supported in composite actions yet. Just the parser is instructed to be relaxed to not throw an error if you invent your own properties, I think you can add anything under an input yaml mapping.Action Inputs are still saved in a, I'm not affiliated with GitHub, only a contributor of one bug fix.Dictionary<string, string>, which cannot even store a true booleanssallmen-pro commentedon Nov 14, 2022
I bumped on this also today. I am calling my composite action from a workflow with a boolean input as follows:
And this is how my composite action
my-org/test-run@mainlooks like from some relevant parts (some debugging added and a lot of things omitted here):That will always echo
realRun==falseon the first step and will never run the second step, independent on whether the input value is given as boolean true or false. That is because it seems therealRuninput value is treated as string in the composite action.I know I can get it working by using string
'true'in the expressions above, instead of booleantrue, but it will work only as long as this bug with treating boolean inputs as strings in a composite action has been fixed.veleek commentedon Nov 17, 2022
I was hoping to do something similiar with the output of a composite action, but there doesn't seem to be any way to force it to be a boolean either. I'm using:
This shouldn't be surprising given that it is documented but it's still frustrating and you end up with the same "always evaluates to false" problem.
machulav commentedon Jan 18, 2023
Agree with @veleek - this is very frustrating to have conditions like the following:
It would be nicer if the outputs were boolean, so the condition looks like this:
The outputs in the composite actions look like this:
sremp commentedon Jan 20, 2023
+1 to this. Just recently ran into this exact issue, with the only reasonable workaround being to use string semantics as detailed in the original post.
justinmchase commentedon Apr 20, 2023
This appears to be true for docker based actions as well.
SatishReddyBethi commentedon Apr 21, 2023
+1
agileshaw commentedon Apr 28, 2023
Just ran into this issue as well. There doesn't seem to be any related information on the official documentation, and it is very non-intuitive to have
inputssupport multiple types in workflows and "normal" actions but not in composite actions. I hope this behavior can be changed.wiegell commentedon May 15, 2023
I just spend several hours trying to pass a true value... The way to do it is:
Job:
Composite:
This makes no sense at all and is not documented.
Fix `load_nixConfig` to be handled correctly
fix: only run Asana jobs if the secrets are present
27 remaining items
Gosh! Booleans or not booleans in composite actions!!!
Gosh! Booleans or not booleans in composite actions!!!
Gosh! Booleans or not booleans in composite actions!!!
GitHub Boolean handling in Actions is TERRIBLE
Fix boolean bug in supervised collector release action (#585)
Fix boolean bug in supervised collector release action (#585)
RobbieMcKinstry commentedon Jul 22, 2025
Any update on this?
fix(ci): Correct boolean comparison in check-version action (#15105)
[skip ci] Fix setup-job to correctly check inputs.use-evaluation-image (
mara004 commentedon Jun 30, 2026
This is a very nasty limitation.
I wonder how to best work around this though? Turn false into empty strings? Explicitly check
== 'true'each time? Wrap infromJSON()? Or ditch composite actions and use reusable workflows instead, accepting the need to allocate a new runner and transfer/recreate state?Tentatively I would go with the first option, turning false into empty strings. Let's see how that goes...
Fix container build action boolean inputs coercion to string (#5294)