Description
Code of Conduct
- I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/actions/learn-github-actions/expressions
What part(s) of the article would you like to see updated?
Some part of the page should explain how:
if: ${{ vars.FOO }}
works. Specifically, if vars.FOO
isn't set, that's presumably treated as the equivalent of an empty something (string?).
if vars.FOO
is set, it's presumably treated as a string.
Note that I'm using vars
above, but the same applies for anything that would naturally be stringy (env
, inputs
(that are stringy), secrets
, outputs
,....)
Are all non-empty strings true?
Is the string "0"
true?
Is the string "false"
true?
There's some prose that says that when comparing two things, if they're of different types, they're converted to numbers.
But it isn't particularly clear if, if: ${{ some_expression }}
is treated as if: ${{ (some_expression) == true }}
which thus results in strings being converted to numbers and true being converted to a number.
Additional information
[maintainer edit]
Content plan here