summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2018-06-25 13:14:35 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2018-06-25 13:14:35 +0000
commit7a99a8c2ce38823ca7336ac4e3cb328274d7338b (patch)
tree2368643987191e0870fdbc137a6bbd2d073e33c6 /lib
parent7668c9660fe30338044afd7886a0fac56e6e82b9 (diff)
parented99467c03531015bec5126b453f5ea4f1cbd4b8 (diff)
downloadgitlab-ce-7a99a8c2ce38823ca7336ac4e3cb328274d7338b.tar.gz
Merge branch 'enforce-variable-value-to-be-a-string' into 'master'
Enforce setting string as value of the CI/CD variable Closes #48210 See merge request gitlab-org/gitlab-ce!20061
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ci/variables/collection/item.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/gitlab/ci/variables/collection/item.rb b/lib/gitlab/ci/variables/collection/item.rb
index d00e5b07f95..222aa06b800 100644
--- a/lib/gitlab/ci/variables/collection/item.rb
+++ b/lib/gitlab/ci/variables/collection/item.rb
@@ -4,6 +4,9 @@ module Gitlab
class Collection
class Item
def initialize(key:, value:, public: true, file: false)
+ raise ArgumentError, "`value` must be of type String, while it was: #{value.class}" unless
+ value.is_a?(String) || value.nil?
+
@variable = {
key: key, value: value, public: public, file: file
}