I am attempting to upgrade our except/only syntax to use rules instead in preparation for the upcoming upgrade.
Here is the original syntax. Notice the @ and then the repo/project are specified. This allows me to ignore branches created on forks of the repository.
only:
- /^release\/v\d+.\d+.\d+$/@myCompany/myProject
When migrating that to use the new rules syntax I am attempting the exact same thing but it fails with an error seen below:
rules:
- if: $CI_COMMIT_BRANCH =~ /^release\/v\d+.\d+.\d+$/@myCompany/myProject
when: always
jobs:build_feature:rules:rule if invalid expression syntax
For some reason the new rules syntax doesn’t like this regex and I’m not sure how to achieve the same thing using rules.