Commit 9f26729a authored by Grzegorz Bizon's avatar Grzegorz Bizon

Use defauly `only` policy defined as a constant

We reuse this constant in EE.
parent 563942ee
...@@ -67,7 +67,7 @@ module Gitlab ...@@ -67,7 +67,7 @@ module Gitlab
entry :only, Entry::Policy, entry :only, Entry::Policy,
description: 'Refs policy this job will be executed for.', description: 'Refs policy this job will be executed for.',
default: { refs: %w[branches tags] } default: Entry::Policy::DEFAULT_ONLY
entry :except, Entry::Policy, entry :except, Entry::Policy,
description: 'Refs policy this job will be executed for.' description: 'Refs policy this job will be executed for.'
......
...@@ -11,6 +11,8 @@ module Gitlab ...@@ -11,6 +11,8 @@ module Gitlab
strategy :RefsPolicy, if: -> (config) { config.is_a?(Array) } strategy :RefsPolicy, if: -> (config) { config.is_a?(Array) }
strategy :ComplexPolicy, if: -> (config) { config.is_a?(Hash) } strategy :ComplexPolicy, if: -> (config) { config.is_a?(Hash) }
DEFAULT_ONLY = { refs: %w[branches tags] }.freeze
class RefsPolicy < ::Gitlab::Config::Entry::Node class RefsPolicy < ::Gitlab::Config::Entry::Node
include ::Gitlab::Config::Entry::Validatable include ::Gitlab::Config::Entry::Validatable
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment