I have some conditions in my steps like:
if: matrix.os == 'ubuntu-latest'
It feels clunky having to repeat "ubuntu-latest" in many places when really what I want to say is just "linux". If I was running on multiple versions of Ubuntu or in the future if there were non-Ubuntu linux options, it would be weird to have to maintain all of these.
Is there some way we could have a field that represents the platform ("win", "mac", "linux" or similar)?
(I just found some people doing "startsWith(matrix.name, 'linux')" which looks slightly better - but still weird, especially as I think it needs to Ubuntu, not Linux).
Solved! Solved! Go to Solution.
We haven't finalized the documentation for the `runner` context yet, but you should be able to safely rely on `runner.os`.