diff options
Diffstat (limited to 'lib/gitlab/ci/config/entry/include.rb')
-rw-r--r-- | lib/gitlab/ci/config/entry/include.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/gitlab/ci/config/entry/include.rb b/lib/gitlab/ci/config/entry/include.rb index ad0ed00aa6f..368d8f07f8d 100644 --- a/lib/gitlab/ci/config/entry/include.rb +++ b/lib/gitlab/ci/config/entry/include.rb @@ -9,8 +9,10 @@ module Gitlab # class Include < ::Gitlab::Config::Entry::Node include ::Gitlab::Config::Entry::Validatable + include ::Gitlab::Config::Entry::Configurable + include ::Gitlab::Config::Entry::Attributable - ALLOWED_KEYS = %i[local file remote template artifact job project ref].freeze + ALLOWED_KEYS = %i[local file remote template artifact job project ref rules].freeze validations do validates :config, hash_or_string: true @@ -27,6 +29,20 @@ module Gitlab errors.add(:config, "must specify the file where to fetch the config from") end end + + with_options allow_nil: true do + validates :rules, array_of_hashes: true + end + end + + entry :rules, ::Gitlab::Ci::Config::Entry::Include::Rules, + description: 'List of evaluable Rules to determine file inclusion.', + inherit: false + + attributes :rules + + def skip_config_hash_validation? + true end end end |