How do I write something like this? At the moment using a colon seems to break everything. Is there an equivalent?
run-name: Something Running ${{ (inputs.cache-retain == 'true') ? '(with forced cache-retain)' : ''}}
e.g.
- if true:
'Something running (with forced cache-retain)'
- if false:
'Something running'
is what I'm looking for.
How do I write something like this? At the moment using a colon seems to break everything. Is there an equivalent?
run-name: Something Running ${{ (inputs.cache-retain == 'true') ? '(with forced cache-retain)' : ''}}
e.g.
- if true:
'Something running (with forced cache-retain)'
- if false:
'Something running'
is what I'm looking for.
Share Improve this question edited Mar 28 at 14:59 dankoiDev asked Mar 28 at 14:41 dankoiDevdankoiDev 1336 bronze badges 1 |1 Answer
Reset to default 1Github Actions doesn't support ternary expressions. But using this workaround should work:
${{ x && 'ifTrue' || 'ifFalse' }}
run: Something Running ${{ inputs.cache-retain == true && "(with forced cache retain)" || "" }}
${{ }}
you're writing a GitHub Actions expression. – jonrsharpe Commented Mar 28 at 14:54