Skip to content

Boolean based on workflow conditions #27029

Answered by Simran-B
aleks-ivanov asked this question in Actions
Discussion options

You must be logged in to vote

Well, you could evaluate an expression in place, like this:

env:
  condition: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && env.BUILD_CONFIGURATION == 'Release' }}

But the env context is only available in steps, so the third condition wouldn’t be possible like this.

Or do you mean to defer evaluation? As in have github.event_name == 'push' && github.ref == 'refs/heads/master' && env.BUILD_CONFIGURATION == 'Release' as string and then evaluate that string in certain places of the workflow, something along ${{ eval(env.condition) }}? That is definitely not supported, and I would guess it’s very unlikely to ever get supported because of security concerns.

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

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