in the answer of this (Trigger Gitlab-CI Pipeline only when there is a new tag ), I understand to set only
as filter
But How can I trigger the pipeline only:
- there is a new tag created, these tags are semantic versioning tags, how can I filter them? something like
only:
- /[0-9]+\.[0-9]+\.[0-9]+/
but the tags are not always as 1.0.2, sometimes, they have beta or fc, such as 0.2.3-rc.1
or 2.3.5-beta
, will the filter to be /[0-9]+\.[0-9]+\.[0-9]+.*/
is fine?
- second rule is, the trigger is only on master or main branch
Regarding the Semantic versioning regex
, I found this gist
https://gist.github.com/jhorsman/62eeea161a13b80e39f5249281e17c39
the sample is too complex
^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$