summaryrefslogtreecommitdiff
path: root/app/services/environments/stop_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/environments/stop_service.rb')
-rw-r--r--app/services/environments/stop_service.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/services/environments/stop_service.rb b/app/services/environments/stop_service.rb
index 24ae658d3d6..54ad94947ff 100644
--- a/app/services/environments/stop_service.rb
+++ b/app/services/environments/stop_service.rb
@@ -18,7 +18,9 @@ module Environments
environments.each { |environment| execute(environment) }
end
- def execute_for_merge_request(merge_request)
+ def execute_for_merge_request_pipeline(merge_request)
+ return unless merge_request.actual_head_pipeline&.merge_request?
+
merge_request.environments_in_head_pipeline(deployment_status: :success).each do |environment|
execute(environment)
end