diff options
Diffstat (limited to 'lib/gitlab/ci/build/rules.rb')
-rw-r--r-- | lib/gitlab/ci/build/rules.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/gitlab/ci/build/rules.rb b/lib/gitlab/ci/build/rules.rb index 89623a809c9..43399c74457 100644 --- a/lib/gitlab/ci/build/rules.rb +++ b/lib/gitlab/ci/build/rules.rb @@ -6,7 +6,14 @@ module Gitlab class Rules include ::Gitlab::Utils::StrongMemoize - Result = Struct.new(:when, :start_in) + Result = Struct.new(:when, :start_in) do + def build_attributes + { + when: self.when, + options: { start_in: start_in }.compact + }.compact + end + end def initialize(rule_hashes, default_when = 'on_success') @rule_list = Rule.fabricate_list(rule_hashes) |