diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-02-27 13:29:08 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-02-27 13:29:08 +0300 |
commit | 1b10b77babf008daf337ff194f10508935a8c8a2 (patch) | |
tree | dc4bd3ccbdabed07f9b5a41a4ffd43d74eb99580 /lib/gitlab/ci/config/entry/include.rb | |
parent | 8909c06a0b2d84a40b5f58a1ab0d955e9bb299bc (diff) | |
parent | 3a2f42925fab6ff398bd85447fbb3bd5ff42cae9 (diff) |
Merge branch 'include-ci-yaml' into 'master'
fix: validate 'include' keywords in gitlab-ci.yml configuration files
Closes #55863
See merge request gitlab-org/gitlab-ce!24098
Diffstat (limited to 'lib/gitlab/ci/config/entry/include.rb')
-rw-r--r-- | lib/gitlab/ci/config/entry/include.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/gitlab/ci/config/entry/include.rb b/lib/gitlab/ci/config/entry/include.rb new file mode 100644 index 00000000000..f2f3dd84eda --- /dev/null +++ b/lib/gitlab/ci/config/entry/include.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Gitlab + module Ci + class Config + module Entry + ## + # Entry that represents a single include. + # + class Include < ::Gitlab::Config::Entry::Node + include ::Gitlab::Config::Entry::Validatable + + ALLOWED_KEYS = %i[local file remote template].freeze + + validations do + validates :config, hash_or_string: true + validates :config, allowed_keys: ALLOWED_KEYS + end + end + end + end + end +end |