I have a few condition commands in the jenkins script and it did not give my expected output, so I broke them down like this:
echo "PY38_RELEASE: ${env.PY38_RELEASE}"
echo "TAG_NAME: ${env.TAG_NAME}"
echo "TAG_NAME: ${env.TAG_NAME != null}"
echo "condition: ${env.PY38_RELEASE || env.TAG_NAME}"
echo "condition: ${env.PY38_RELEASE || env.TAG_NAME != null}"
Then I observe the output, and I got this:
[2024-03-14T02:18:14.115Z] PY38_RELEASE: false
[2024-03-14T02:18:14.125Z] TAG_NAME: null
[2024-03-14T02:18:14.135Z] TAG_NAME: false
[2024-03-14T02:18:14.145Z] condition: true
[2024-03-14T02:18:14.155Z] condition: true
I don't get it when the env.PY38_RELEASE
is false and env.TAG_NAME != null
is false, however their OR
is true. Where did I get it wrong?