Pipeline Job only when pattern matches not recognized

i’m trying to create a Job in my CI Pipeline that only runs when certain variable match a pattern flavored with the job name. Runner is a windows machine with powershell as executer.

So i have this yaml anchor and

.build: &build
        - $CI_JOB_NAME =~ /build_$env:PROJECT/

and the job look like:

  <<: *build

So if i run a manual ci pipeline from the gitlab ui with the environment variable $PROJECT set to “projectone”, it should run the job but it will be skipped instead.

i already tried to give the variables condition a different touch with and with env_, only with _ and so on but nothing helps.

Can anyone tell me whats wrong with the yaml?


I’m not sure if that matches 1:1 but I could imagine that these feature requests have an influence here.