Project Key Pattern with GITLAB creation project

Hi, I am using Community Edition, Version 7.6 (build 21501). I know that I need to upgrade it…
I am working with GITLAB Plugin and I’created a custom template at pipeline that the projects are created with the project slug…

- 'dotnet sonarscanner begin /k:"%CI_PROJECT_PATH_SLUG%" /d:sonar.login="%UsrSonarToken%"'

The namespace of each project starts with the business area, like a “infra-yyy”, “logistics-xxxx”, and I’m trying to create a Permission Template with this regular expressions “infra-", but it doesn’t work. I’ve tried "\infra-”, “infra*”, “^infra**” and the new project is created but always with the default permissions. Can anyone help me, please…

Hi @alevenelli,

Welcome to the Community :smiley:

The regular expressions used in Permission Templates are “real” regexes, meaning that characters like . (full stop) and * (asterisk) have special meanings. For your purposes, . means “any character” and * means “any number of whatever the token was immediately before the asterisk” so .* means “any number of any character”. Put that all together and the regex that I think you want is:

infra-.*

There are some really useful online regex checkers available; I use this one all the time.

Regards,

Cameron.

Thanks, Cameron. Its working now… It will help me a lot…

Glad to hear it’s working! :smiley:

Regards,

Cameron.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.