Skip to content

How to run steps involving environment variables on both Linux and Windows #25071

Answered by weide-zhou
jonhue asked this question in Actions
Discussion options

You must be logged in to vote

‘shell’ is not recognized because it’s not the value of workflow context. As a workaround, you can use below condition instead.

Typically you can use the context value for the condition filter when access to environment variable is necessary. Please check the link here for more details.

if: runner.os == 'Linux'
… bash command
If: runner.os == 'Windows'
… powershelll command

or 

if: matrix.os == 'ubuntu-latest'
… bash command
If: matrix.os == 'windows-latest'
… powershelll command

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants