If statement in expression

Is it possible to use an if statement inside of an expression?

${{ if runner.os == 'macOS' then 'xyz' else 'abc' }}
3 Likes

I’d like to be able to do:

env:
  LEGACY: ${{ matrix.php != '7.4-rc' ? '1' : '0' }}