I am using an anchor for defining list of branches to run some stages of my pipeline on like so:
.branches:
&BRANCHES:
- master
- my-feature-branch
I want to use the rules in a way that it checks if the commit branch is same as one of the branches listed in the BRANCHES variable, and if true then do something:
rules:
- if: ($CI_COMMIT_BRANCH in *BRANCHES)
// Do something
I know this syntax is wrong, so how can I achieve this?