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

input.rb « header « config « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 76a89a3080eae3b547fa205bc539e887e2089703 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

module Gitlab
  module Ci
    class Config
      module Header
        ##
        # Input parameter used for interpolation with the CI configuration.
        #
        class Input < ::Gitlab::Config::Entry::Node
          include ::Gitlab::Config::Entry::Validatable
          include ::Gitlab::Config::Entry::Attributable

          attributes :default, :type, prefix: :input

          validations do
            validates :config, type: Hash, allowed_keys: [:default, :type]
            validates :key, alphanumeric: true
            validates :input_default, alphanumeric: true, allow_nil: true
            validates :input_type, allow_nil: true, allowed_values: Interpolation::Inputs.input_types
          end
        end
      end
    end
  end
end