BigW Consortium Gitlab

Commit db6b2b18 by Lin Jen-Shin

Show open merge request against default branch if exists

parent 8de8506d
......@@ -13,6 +13,10 @@ module Emails
def pipeline_mail(pipeline, to, status)
@project = pipeline.project
@pipeline = pipeline
@merge_request = @project.merge_requests.opened.
find_by(source_project: @project,
source_branch: @pipeline.ref,
target_branch: @project.default_branch)
add_headers
mail(to: to, subject: pipeline_subject(status))
......
......@@ -94,8 +94,9 @@
%td{:style => "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;"}
%a.muted{:href => namespace_project_commits_url(@project.namespace, @project, @pipeline.ref), :style => "color:#333333;text-decoration:none;"}
= @pipeline.ref
- if @merge_request
(
%a{:href => "{{{merge-request-link}}}", :style => "color:#3084bb;text-decoration:none;white-space: nowrap;"}> merge request
%a{:href => namespace_project_merge_request_url(@project.namespace, @project, @merge_request), :style => "color:#3084bb;text-decoration:none;white-space: nowrap;"}> merge request
)
%tr
%td{:style => "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;color:#8c8c8c;font-weight:300;padding:14px 0;margin:0;border-top:1px solid #ededed;"} Commit
......
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