For a Gitlab job I need a regex that matches all branches starting with release/
.
For example:
release/1
release/v1
release/v1.1
release/communityedition
My job rule that's not working is:
myjob:
image: mycustomimage
stage: mystage
rules:
- if: $CI_COMMIT_BRANCH == "master"
when: never
- if: $CI_COMMIT_BRANCH == "dev"
when: never
- if: $CI_COMMIT_BRANCH =~ /^release\/'
CodePudding user response:
Try changing /^release\/'
into /^release\//'
.
The \
escapes the near /
, so you must add an additional trailing /
.