diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2019-02-08 17:43:17 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2019-02-08 17:43:17 +0300 |
commit | dec416aae4bfb7059de4284516e59b49e3825ebf (patch) | |
tree | d0a14134fb0b8b920702072e7ff63b862f90f280 /lib | |
parent | ff02a16ebf84ff5374eaa01bd65378574ce65390 (diff) |
Use safer regex to define major/minor versions
Diffstat (limited to 'lib')
-rw-r--r-- | lib/task_helpers.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/task_helpers.rb b/lib/task_helpers.rb index c3fa691f..941c3c96 100644 --- a/lib/task_helpers.rb +++ b/lib/task_helpers.rb @@ -1,7 +1,7 @@ require 'yaml' PRODUCTS = %W[ce ee omnibus runner debug].freeze -VERSION_FORMAT = /^(\d{1,2})\.(\d{1,2})$/ +VERSION_FORMAT = /^(?<major>\d{1,2})\.(?<minor>\d{1,2})$/ def config # Parse the config file and create a hash. @@ -23,9 +23,9 @@ def retrieve_branch(slug) if version = ENV["CI_COMMIT_REF_NAME"].match(VERSION_FORMAT) case slug when 'ee' - "#{version[1]}-#{version[2]}-stable-ee" + "#{version[:major]}-#{version[:minor]}-stable-ee" when 'ce', 'omnibus', 'runner' - "#{version[1]}-#{version[2]}-stable" + "#{version[:major]}-#{version[:minor]}-stable" else 'master' end |