-
Hello, I have defined a variable and I want to access it from a if statement:
But I am getting: The workflow is not valid. .github/workflows/deploy.yml (Line: 87, Col: 9): Unrecognized named-value: ‘env’. Located at position 1 within expression: env.ALLOWED_OWNER What is wrong? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
The if condition is syntactically wrong, the entire expression must be wrapped in But that aside, you cannot reference the
Contexts - GitHub Docs |
Beta Was this translation helpful? Give feedback.
-
Damn, thanks. I need to run two of our jobs on the same conditions, it is a complex query unfortunately and I want to share it somewhere. |
Beta Was this translation helpful? Give feedback.
-
lzap:
Your best bet for something like that is probably to have a job that calculates the condition as an output, then the other jobs |
Beta Was this translation helpful? Give feedback.
The if condition is syntactically wrong, the entire expression must be wrapped in
${{ }}
or not at all.But that aside, you cannot reference the
env
context here:Contexts - GitHub Docs