In the only
section of my .gitlab-ci.yml
I can match a branch name by regex like:
only:
- /^issue-.*/
and match a branch name for a specific branch and repo like:
only:
- issue-123@mygroup/myproject
But how do I do both? I tried this:
only:
- /^issue-.*@mygroup\/myproject/
but with no success.
I'm using GitLab Community Edition 8.17.4.
It appears the group/project name part cannot be part of the regex in 8.17.
Testing with gitlab 8.17.5-ce, I can use regex for the branch name followed by string only group/project name to select specific branches to build on, like this:
only:
- /^issue-.*/@mygroup/myproject
In context:
stages:
- build
build-any-issue-on-mygroup-myproject:
stage: build
script:
- echo "hello"
only:
- /^issue-.*/@mygroup/myproject
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With