I’m trying to define a regex expression as a global variable in gitlab-ci.yml
.
the variable is:
variables:
-SPEEDY_REGEX: '(chore|docs|feat|fix|refactor|style|test)\:( |\t)+\[SPEEDY\].*'
now I want to use it in if statements for getting specific builds to run:
build:
rules:
- if : '$CI_COMMIT_MESSAGE =~ $SPEEDY_REGEX'
when: never
- when: on_success
build:speedy:
rules:
- if : '$CI_COMMIT_MESSAGE =~ $SPEEDY_REGEX'
when: on_success
- when: never
This didn’t want to work for a reason I ignore.