Bors crashing with multiple workflows


We have been using bors for a while and it was working well for us. We used to have just one app in our repo with one GH workflow for PR validation which worked perfectly. Recently we have decided to add another app in the repo (making it mono repo) and we created separate PR validation workflows for them. Each of the PR validation workflow post the same status message when complete "Pre-Merge Build". With the following setup bors correctly merges PR with one workflow

status = ["Pre-Merge Build"]
pr_status = ["Pre-Merge Build"]
required_approvals = 1
use_codeowners = true
timeout_sec = 10800
delete_merged_branches = true
up_to_date_approvals = true
use_squash_merge = true

But in the PR where we added the second workflow, it just crashes

  {:error, :push, 422,
   "{\"message\":\"Required status check \\\"Pre-Merge Build\\\" is in progress.\",\"documentation_url\":\"\"}"}},
   {BorsNG.Worker.Batcher, :complete_batch, 3,
    [file: 'lib/worker/batcher.ex', line: 712]},
   {BorsNG.Worker.Batcher, :maybe_complete_batch, 1,
    [file: 'lib/worker/batcher.ex', line: 658]},
   {BorsNG.Worker.Batcher, :handle_cast, 2,
    [file: 'lib/worker/batcher.ex', line: 94]},
   {:gen_server, :try_dispatch, 4,
    [file: 'gen_server.erl', line: 689]},
   {:gen_server, :handle_msg, 6,
    [file: 'gen_server.erl', line: 765]},
   {:proc_lib, :init_p_do_apply, 3,
    [file: 'proc_lib.erl', line: 226]}

I can see that it successfully pushed the commit to the staging branch, where we have the two workflows running. But as soon as the first workflow finishes, bors crashed with this message while the second workflow is still running.

Are we doing something wrong. Is there a way to support multiple workflow with same status. We used same status as our main branch is protected using this Status check

This isn't going to work correctly, because bors assumes that the names you put there are unique. It isn't possible for bors to know how many there are supposed to be, which means that it couldn't be sure that they were all done.

If you want to have some sort of complex CI/CD matrix and don't want to list them out by hand in bors.toml, the trick is to define a dummy task that depends on all the other ones, like this one. This is because, even though bors doesn't know what the whole GitHub Actions matrix should be, GitHub Actions knows.

Thanks for the feedback. I will try to follow the approach to solve my issue

@notriddle I am bit confused because the example you have provided is not similar to what I'm facing. In the example you have two jobs in the same workflow and the third CI job would pass depending on the build and test job. In my case I have two individual workflows (each one of them can be skipped based on path filter). Each workflow has job with the same name "Pre-Merge Build". I am not sure how in GH I can create another workflow that would trigger when all of these two workflows finishes. I found workflow_run:
but it would trigger the CI workflow when any one of the Build workflow runs