Hi @yousefhamza,
Maybe you could use the same logic as this workaround
In your case though, the loop in the waiter
job would be slightly different:
- run: |
until [[ $(curl --location --request GET "https://circleci.com/api/v2/workflow/$CIRCLE_WORKFLOW_ID/job" --header "Circle-Token: $CCI_TOKEN"| jq -r '.items[]|select(.name == "job1" or .name == "job2")|.status' | grep -c "success") -gt 0 ]]; do
sleep 1
done
And then your workflow would be:
workflows:
version: 2
build-test-and-generate-binary:
jobs:
- job1
- job2
- waiter
- job3:
type: approval
requires:
- waiter
- job4:
requires:
- job3
With the above configuration, job3
will start as soon as either job1
or job2
finishes successfully.