Job is not adhering to the if check #24987
-
Hi, I have an initial job which checks AWS ECR if an image exists and then sets an output which I use in the next job. This works fine in one of my repositories, I.E when BUILD = ‘NO’ the job is skipped. For some reason in this repository the job always gets ran and I have no idea why. Here is the relevant config.
No matter what, the second job runs, when I would assume it shouldn’t.
Is there something I am overlooking here? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
tsposato:
The problem is that you have only part of your conditional wrapped in For an
|
Beta Was this translation helpful? Give feedback.
-
Thanks! This did indeed fix my issue. Cheers. |
Beta Was this translation helpful? Give feedback.
The problem is that you have only part of your conditional wrapped in
${{ ... }}
. That way only the wrapped part is evaluated as an expression, resulting in a string likeNO == 'YES'
. And a non-empty string evaluates totrue
.For an
if
it’s easiest to just remove the${{ ... }}
part: