diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-24 15:06:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-24 15:06:49 +0300 |
commit | af5193aa3cc159fd7d08be988bd00f1921077117 (patch) | |
tree | 664d9936ab99208c49b8721877be87b7e420d5bd /lib/gitlab/ci | |
parent | 4dcdd5bebb55bd5522ec180070d4d265e00943b5 (diff) |
Diffstat (limited to 'lib/gitlab/ci')
-rw-r--r-- | lib/gitlab/ci/config/external/mapper.rb | 1 | ||||
-rw-r--r-- | lib/gitlab/ci/config/external/mapper/normalizer.rb | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab/ci/config/external/mapper.rb b/lib/gitlab/ci/config/external/mapper.rb index cff7954235f..fcd65b2f2d7 100644 --- a/lib/gitlab/ci/config/external/mapper.rb +++ b/lib/gitlab/ci/config/external/mapper.rb @@ -11,6 +11,7 @@ module Gitlab AmbigiousSpecificationError = Class.new(Error) TooManyIncludesError = Class.new(Error) TooMuchDataInPipelineTreeError = Class.new(Error) + InvalidTypeError = Class.new(Error) def initialize(values, context) @locations = Array.wrap(values.fetch(:include, [])).compact diff --git a/lib/gitlab/ci/config/external/mapper/normalizer.rb b/lib/gitlab/ci/config/external/mapper/normalizer.rb index 8fc798e78a0..b07726f7c11 100644 --- a/lib/gitlab/ci/config/external/mapper/normalizer.rb +++ b/lib/gitlab/ci/config/external/mapper/normalizer.rb @@ -25,8 +25,10 @@ module Gitlab location = variables_expander.expand(location) normalize_location_string(location) - else + elsif location.is_a?(Hash) location.deep_symbolize_keys + else + raise Mapper::InvalidTypeError, 'Each include must be a hash or a string' end end end |