Inputs take default values on non-manual trigger #29242
-
I have the workflow that is defining the triggers in the following way (full workflow available ➡️ https://github.com/stargate/stargate/blob/master/.github/workflows/release.yml):
and then have a conditional step based on the input like:
I was expecting that when the job is triggered with the tag push, that
But in the run that was triggered by the tag push, it's clear that the condition resolves as false and step is skipped. How can this be? Are input defaults available in the non-manual triggers? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
I have a suspicion at least, and it has to do with type conversion. The
If you read those rules, false gets converted to zero, and so does an empty string. It's kind of like Javascript. 😅 I'd try this: if: ${{ inputs.publish }} Should work if |
Beta Was this translation helpful? Give feedback.
-
I have the same issue, but the proposed solution does not seem to work. Consider the following:
if
It seems that the expression fails to evaluate. Any thoughts? |
Beta Was this translation helpful? Give feedback.
-
It might be useful for someone!
|
Beta Was this translation helpful? Give feedback.
I have a suspicion at least, and it has to do with type conversion. The
push
event doesn't have aninputs
context, soinputs.publish
evaluates to an empty string. And the expression operators documentation describes:If you read those rules, false gets converted to zero, and so does an empty string. It's kind of like Javascript. 😅
I'd try this:
Should work if
inputs.publish
is a boolean, and an empty string should behave likefalse
.