Use "Pipelines must succeed" only in protected branches


Is there any way to enable “Pipelines must succeed” only in protected branches?

I tried to run the jobs only when the target branch is protected. But gitlab doesn’t create the pipeline if it’s empty.

Now I have a dummy job which runs when the target branch is not protected, but it’s a little trick.

I saw this issue: Can accept merge request before external build system completion (#54226) · Issues · / GitLab FOSS · GitLab and seems like allow_merge_if_pipeline_not_present didn’t be developed?

Hi @JoniJnm

there is currently no such feature. I found a feature request here Move Merge Checks, and Merge request approvals settings into protected branch rules (#31130) · Issues · / GitLab · GitLab