diff options
Diffstat (limited to 'app/models/ci/commit.rb')
-rw-r--r-- | app/models/ci/commit.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index 31da7e8f2b6..c77921979a6 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -224,6 +224,16 @@ module Ci update!(committed_at: DateTime.now) end + def should_create_next_builds?(build) + # don't create other builds if this one is retried + other_builds = builds.similar(build).latest + return false unless other_builds.include?(build) + + other_builds.all? do |build| + build.success? || build.ignored? + end + end + private def save_yaml_error(error) |