0

My question is related to How do I break a string in YAML over multiple lines?, but with an additional bit of complexity.

I want to build a multi-line string, but only include some lines if a certain condition is met. This is how I would ideally be able to do it:

key: |
  foo
  bar
  ${{ github.event.inputs.baz != "" ? "baz" : "" }}

Basically, include the "baz" if and only if the input passed to the GitHub event is not empty (""). How can I do this?

Paul Razvan Berg
  • 10,820
  • 7
  • 50
  • 86

0 Answers0