Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2019-02-08 17:43:17 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2019-02-08 17:43:17 +0300
commitdec416aae4bfb7059de4284516e59b49e3825ebf (patch)
treed0a14134fb0b8b920702072e7ff63b862f90f280 /lib
parentff02a16ebf84ff5374eaa01bd65378574ce65390 (diff)
Use safer regex to define major/minor versions
Diffstat (limited to 'lib')
-rw-r--r--lib/task_helpers.rb6
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