Trigger on completion of two disjoint actions #25518
-
I have a use case where I need to trigger an action upon the completion of BOTH of two upstream actions. I know we could use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Suppose your three workflows are wf1 , wf2 and wf3 , wf1 and wf2 are the upstream works triggered simultaneously. And you want that wf3 is triggered only when both wf1 and wf2 are completed. As you mentioned, because wf1 and wf2 are triggered simultaneously, and the time they spend is indeterminable, so we can’t be sure which one of wf1 and wf2 we should add the repository_dispatch event into. And there is no any other method (APIs or actions) that can be used to monitor the status of wf1 and wf2 in real time. However, if wf1 and wf2 are in the same repository, as a workaround, you can combine them as two separate jobs ( job1 and job2 ) in one workflow, and the two jobs can run in parallel. In the workflow, you also need a third job ( job3 ) used to trigger wf3 via the repository_dispatch event after both job1 and job2 are completed.
If wf3 is also in the same repository, you can combine wf3 into the workflow as job3 instead of using the repository_dispatch event to trigger wf3.
|
Beta Was this translation helpful? Give feedback.
Suppose your three workflows are wf1 , wf2 and wf3 , wf1 and wf2 are the upstream works triggered simultaneously. And you want that wf3 is triggered only when both wf1 and wf2 are completed.
As you mentioned, because wf1 and wf2 are triggered simultaneously, and the time they spend is indeterminable, so we can’t be sure which one of wf1 and wf2 we should add the repository_dispatch event into. And there is no any other method (APIs or actions) that can be used to monitor the status of wf1 and wf2 in real time.
However, if wf1 and wf2 are in the same repository, as a workaround, you can combine them as two separate jobs ( job1 and job2 ) in one workflow, and the two jobs can run in paralle…