diff options
Diffstat (limited to 'lib/gitlab/ci/config/entry')
-rw-r--r-- | lib/gitlab/ci/config/entry/processable.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/variables.rb | 16 |
2 files changed, 7 insertions, 11 deletions
diff --git a/lib/gitlab/ci/config/entry/processable.rb b/lib/gitlab/ci/config/entry/processable.rb index 975da8662e1..78794f524f4 100644 --- a/lib/gitlab/ci/config/entry/processable.rb +++ b/lib/gitlab/ci/config/entry/processable.rb @@ -120,7 +120,7 @@ module Gitlab stage: stage_value, extends: extends, rules: rules_value, - job_variables: variables_entry.value_with_data, + job_variables: variables_value.to_h, root_variables_inheritance: root_variables_inheritance, only: only_value, except: except_value, diff --git a/lib/gitlab/ci/config/entry/variables.rb b/lib/gitlab/ci/config/entry/variables.rb index 3130aec0446..efb469ee32a 100644 --- a/lib/gitlab/ci/config/entry/variables.rb +++ b/lib/gitlab/ci/config/entry/variables.rb @@ -18,9 +18,7 @@ module Gitlab end def value - @config.to_h do |key, data| - [key.to_s, expand_data(data)[:value]] - end + @config.to_h { |key, value| [key.to_s, expand_value(value)[:value]] } end def self.default(**) @@ -28,9 +26,7 @@ module Gitlab end def value_with_data - @config.to_h do |key, data| - [key.to_s, expand_data(data)] - end + @config.to_h { |key, value| [key.to_s, expand_value(value)] } end def use_value_data? @@ -39,11 +35,11 @@ module Gitlab private - def expand_data(data) - if data.is_a?(Hash) - { value: data[:value].to_s, description: data[:description] }.compact + def expand_value(value) + if value.is_a?(Hash) + { value: value[:value].to_s, description: value[:description] } else - { value: data.to_s } + { value: value.to_s, description: nil } end end end |