Skip to content

Inputs take default values on non-manual trigger #29242

Discussion options

You must be logged in to vote

I have a suspicion at least, and it has to do with type conversion. The push event doesn't have an inputs context, so inputs.publish evaluates to an empty string. And the expression operators documentation describes:

GitHub performs loose equality comparisons.

  • If the types do not match, GitHub coerces the type to a number. GitHub casts data types to a number using these conversions: [...]

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 inputs.publish is a boolean, and an empty string should behave like false.

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@ivansenic
Comment options

@tatu-at-datastax
Comment options

@airtower-luna
Comment options

@ivansenic
Comment options

Answer selected by ivansenic
Comment options

You must be logged in to vote
2 replies
@airtower-luna
Comment options

@IanTaylor-catapult
Comment options

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