Commit 3f93f88d authored by Michał Zając's avatar Michał Zając

Return last 10 successful pipelines

parent 00493319
......@@ -151,8 +151,8 @@ class Vulnerability < ApplicationRecord
# See https://gitlab.com/gitlab-org/gitlab/-/issues/218012
latest_successful_pipeline = project
.ci_pipelines
.newest_first(ref: project.default_branch, limit: 10)
.success
.newest_first(ref: project.default_branch, limit: 10)
.find { |pipeline| pipeline.builds.any? { |build| build.name == self.report_type } }
# Technically this shouldn't ever happen.
......
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