Trigger pipeline for merge request if target branch was updated


My case:

  1. The first developer creates branch with feature b1 from dev branch.
  2. The second developer creates branch with feature b2 from dev branch.
  3. The first developer creates merge request (mr1).
  4. The Second developer creates merge request (mr2).
  5. Each merge request trigger pipeline with tests. Tests ok because.
  6. The first branch merged to dev successfully.
  7. The second branch merged to dev successfully but broke dev branch because was not tested with code from the first branch.

So is there a way to trigger pipeline with tests for the second branch after the first branch was merged to dev?

Диаграмма без названия