Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Triggering GitLab push events on multiple branches

How can I set two or more branches to trigger the hook? enter image description here

For example: I have three branches: master; develop and fix. I want the hook to work for master and develop.

like image 578
Andrey RF Avatar asked Nov 19 '25 10:11

Andrey RF


1 Answers

gitlab-org/gitlab-foss issue 20338 which introduced "filter push events by branch" in GitLab 11.3 (Sept. 2018) includes:

support for branch patterns with wildcards (*), like we do with protected branches.

So the pattern itself is fairly limited:

| Wildcard Protected Branch | Matching Branches                                |
|===========================|==================================================|
| *-stable                  | production-stable, staging-stable                |
| production/*              | production/app-server, production/load-balancer  |
| *gitlab*                  | gitlab, gitlab/staging, master/gitlab/production |

There is no xxx|yyy or syntax.

In your case, the pattern *e* would be enough to select only master and develop, not fix.

like image 196
VonC Avatar answered Nov 22 '25 04:11

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!