Use defauly `only` policy defined as a constant
We reuse this constant in EE.
This commit is contained in:
parent
563942ee3d
commit
9f26729af5
|
@ -67,7 +67,7 @@ module Gitlab
|
|||
|
||||
entry :only, Entry::Policy,
|
||||
description: 'Refs policy this job will be executed for.',
|
||||
default: { refs: %w[branches tags] }
|
||||
default: Entry::Policy::DEFAULT_ONLY
|
||||
|
||||
entry :except, Entry::Policy,
|
||||
description: 'Refs policy this job will be executed for.'
|
||||
|
|
|
@ -11,6 +11,8 @@ module Gitlab
|
|||
strategy :RefsPolicy, if: -> (config) { config.is_a?(Array) }
|
||||
strategy :ComplexPolicy, if: -> (config) { config.is_a?(Hash) }
|
||||
|
||||
DEFAULT_ONLY = { refs: %w[branches tags] }.freeze
|
||||
|
||||
class RefsPolicy < ::Gitlab::Config::Entry::Node
|
||||
include ::Gitlab::Config::Entry::Validatable
|
||||
|
||||
|
|
Loading…
Reference in New Issue