Is it possible to create a condition using the result of a bash script?

Not in the way that you have expressed in your example.

The limitation is that conditions are evaluated at the time the config.yml file is compiled and so dynamic checking is not possible.

The solution to this issue is the “Dynamic Config” feature, which would allow you to collect the dynamic info you need and then pass it on to an independent yml script that can accept the info as parameters.