I need to fan-out 2 jobs (lets say A and B) in parallel via build-router-start/build-router-wait but one of the job (B) should be run only if the condition X is true.
I thought I could do this with the following steps:
- Script: Evaluate the condition X and if true add the env variable START_BUILD
- Bitrise start build: Start job A
- Bitrise start build: Start job B, only if the env START_BUILD is true via run_if
- … do sth on main workflow…
- Wait for build: Wait for job B, run_if START_BUILD is true
- Wait for build: Wait for job A
Now the problem is that I do not know how to correlate start/wait with job A, and start/wait with job B. Running second “Bitrise start build” (B) overwrites the first one (A) so wait step only waits for the second job (B).
The other solution I thought would be to run single “Bitrise start build” with 2 workflows specified A and B, but not sure how to insert the condition for job B there.
Is there any other way I can address this problem or perhaps I’m missing sth in the approaches above?