Skip to content

Strange boolean evaluation rules #25645

Answered by jsoref
travisdowns asked this question in Actions
Discussion options

You must be logged in to vote

env defines strings.

Consider this (node):

% node
Welcome to Node.js v16.7.0.
Type ".help" for more information.
> "false" && "true"
'true'
> "false" || "true"
'false'
> !"false"
false
> !"true"
false
> !!"true"
true

To do what you’re trying to do, you’d probably want something like:

      echo "VARF && VART=${{ fromJSON(env.VARF) && fromJSON(env.VART) }}"

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants