I am trying to find the best way to use a wildcard regex statement when using an include:rules:if statement, but I have tried dozens of versions without luck, and I have searched endlessly on this topic, but either the documentation referenced is no longer there, or the examples aren’t sufficient.
This example works when I explicitly name the file:
include:
- local: my.gitlab-ci.yml
rules:
- if: $CI_COMMIT_BRANCH == "test_lst_r1"
But I need something like this to work:
include:
- local: my.gitlab-ci.yml
rules:
- if: $CI_COMMIT_BRANCH == "*_lst_r1"
I’ve tried multiple variations on this, but without luck:
=~ /^_lst_r1/
=~ /^((?!_lst_r1).)*$/
=~ /^.*$_lst_r1/
etc
Appreciate any help/insight into getting this to work.
Thanks