Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/ci/config/entry/include.rb')
-rw-r--r--lib/gitlab/ci/config/entry/include.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/ci/config/entry/include.rb b/lib/gitlab/ci/config/entry/include.rb
index cd09d83b728..9c2e5f641d0 100644
--- a/lib/gitlab/ci/config/entry/include.rb
+++ b/lib/gitlab/ci/config/entry/include.rb
@@ -15,6 +15,14 @@ module Gitlab
validations do
validates :config, hash_or_string: true
validates :config, allowed_keys: ALLOWED_KEYS
+
+ validate do
+ next unless config.is_a?(Hash)
+
+ if config[:artifact] && config[:job].blank?
+ errors.add(:config, "must specify the job where to fetch the artifact from")
+ end
+ end
end
end
end