Skip to content
Snippets Groups Projects
Commit 4ad63c29 authored by Lin Jen-Shin's avatar Lin Jen-Shin
Browse files

Fixed the names and add missing check

parent 2ccd4c32
No related branches found
No related tags found
1 merge request!6019Add a new pipeline email service
Pipeline #
Loading
Loading
@@ -7,7 +7,7 @@ class PipelinesEmailService < Service
if: ->(s) { s.activated? && !s.add_pusher? }
 
def initialize_properties
self.properties ||= { notify_only_broken_builds: true }
self.properties ||= { notify_only_broken_pipelines: true }
end
 
def title
Loading
Loading
@@ -28,7 +28,7 @@ class PipelinesEmailService < Service
 
def execute(data, force = false)
return unless supported_events.include?(data[:object_kind])
return unless force || should_build_be_notified?(data)
return unless force || should_pipeline_be_notified?(data)
 
all_recipients = retrieve_recipients(data)
 
Loading
Loading
@@ -73,10 +73,12 @@ class PipelinesEmailService < Service
{ success: false, result: error }
end
 
def should_build_be_notified?(data)
def should_pipeline_be_notified?(data)
case data[:object_attributes][:status]
when 'success'
!notify_only_broken_pipelines?
when 'failed'
true
else
false
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment