Run a branch pipeline only if not a merge request?

I want a pipeline to run for commits to branches other than merge request branches or my default branch.

So, my pipelines should work like this:

  1. commit to branch a and pipeline fires with manual steps
  2. create a merge request for branch a and merge request pipeline fires and runs automatically in certain environments.
  3. merge to default branch and release is created and pipeline for default branch runs.

What I am seeing is that after I have a merge request and push additional changes I get two pipelines one for changes to a branch and one for changes in a merge request. Once my branch is part of a merge request could I make it so the branch pipeline no longer fires?

I think you are attempting to do something that I have done. I am asking for advise on how to do this better but if you checkout my post I think it is similar in what you are attempting to do


Please have a look at official solution to avoid duplicate pipelines.