diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /lib/gitlab/ci/config/entry/include.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
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 |