debian-mirror-gitlab/lib/gitlab/ci/config/entry/tags.rb
2022-01-26 12:08:38 +05:30

28 lines
675 B
Ruby

# frozen_string_literal: true
module Gitlab
module Ci
class Config
module Entry
##
# Entry that represents an array of tags.
#
class Tags < ::Gitlab::Config::Entry::Node
include ::Gitlab::Config::Entry::Validatable
TAGS_LIMIT = 50
validations do
validates :config, array_of_strings: true
validate do
if config.is_a?(Array) && config.size >= TAGS_LIMIT
errors.add(:config, _("must be less than the limit of %{tag_limit} tags") % { tag_limit: TAGS_LIMIT })
end
end
end
end
end
end
end
end