CI triggers jobs with false variable expression when using the `=~` operator
Summary
GitLab CI triggers jobs that have false variable expressions when using the =~
operator.
For instance, we are using the following pattern to match version tags and jobs are triggered even when $CI_COMMIT_TAG
is empty.
only:
variables:
- $CI_COMMIT_TAG =~ /^v*/`
Steps to reproduce
Define a job with an only: variables
clause using the =~
operator will always pass on an empty variable.
Example Project
https://gitlab.com/mbergeron/test/tree/fc29d900facd65d9f9e9336eedebe31cf92fb6f0
What is the current bug behavior?
The job is triggered.
What is the expected correct behavior?
The job should not be triggered.
Output of checks
This bug happens on GitLab.com
Possible fixes
This seems to be a regression, because we have been relying on this behavior for several months, I believe it could have been introduced in the last two weeks, so that would fit the 22nd of August — GitLab v12.2