Improve syntax for variables expressions in 'only' and 'except': regex
Description
We have a basic support for variables expressions in only
and except
keyworks, but the original proposal was cut in scope to keep it small and simple in the first iteration. We can now consider additional improvements that are useful to real cases and implement them.
Adding the regex operator will allow jobs to be done/not done based on patterns.
Some examples:
- Skip a job based on a custom commit message
except:
variables:
- $CI_COMMIT_MESSAGE =~ /ci-skip-e2e/
- Run a job only if the feature is supported in the current GitLab instance/account
only:
variables:
- $GITLAB_FEATURES =~ /dependency_scanning/
Proposal
Support for =~
operator (regex)
Edited by Fabio Busatto