在 Custom notification events 中已经取消了"Successful pipeline"的选择,但GitLab持续集成功时总是发通知邮件。
请问如何解决这个问题?
在 /opt/gitlab/embedded/service/gitlab-rails/app/services/notification_service.rb 中,在 pipeline_finished 方法的开头添加 return if pipeline.status == "success" 。
def pipeline_finished(pipeline, recipients = nil) return if pipeline.status == "success" email_template = "pipeline_#{pipeline.status}_email" return unless mailer.respond_to?(email_template) recipients ||= build_recipients( pipeline, pipeline.project, nil, # The acting user, who won't be added to recipients action: pipeline.status).map(&:notification_email) if recipients.any? mailer.public_send(email_template, pipeline, recipients).deliver_later end end