Skip to content

Commit caf36f9

Browse files
Kshitij-KatiyarRaghav Aggarwal
andauthored
[MM-856]: Added the requested reviewers in the pulls_created notification (#859)
* [MM-856]: Added the requested reviewers in the pulls_created notification * Update server/plugin/template.go Co-authored-by: Raghav Aggarwal <[email protected]> --------- Co-authored-by: Raghav Aggarwal <[email protected]>
1 parent 3d40b35 commit caf36f9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

server/plugin/template.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ Labels: {{range $i, $el := .Labels -}}` + "{{- if $i}}, {{end}}[`{{ $el.Name }}`
217217
{{- if .Assignees }}
218218
Assignees: {{range $i, $el := .Assignees -}} {{- if $i}}, {{end}}{{template "user" $el}}{{end -}}
219219
{{- end -}}
220+
`))
221+
222+
template.Must(masterTemplate.New("reviewer").Funcs(funcMap).Parse(`
223+
{{- if .RequestedReviewers }}
224+
Reviewers: {{range $i, $el := .RequestedReviewers -}} {{- if $i}}, {{end}}{{template "user" $el}}{{end -}}
225+
{{- end -}}
220226
`))
221227

222228
template.Must(masterTemplate.New("newDraftPR").Funcs(funcMap).Parse(`
@@ -233,6 +239,7 @@ Assignees: {{range $i, $el := .Assignees -}} {{- if $i}}, {{end}}{{template "use
233239
{{- if ne .Config.Style "skip-body" -}}
234240
{{- template "labels" dict "Labels" .Event.GetPullRequest.Labels "RepositoryURL" .Event.GetRepo.GetHTMLURL }}
235241
{{- template "assignee" .Event.GetPullRequest }}
242+
{{- template "reviewer" .Event.GetPullRequest }}
236243
237244
{{.Event.GetPullRequest.GetBody | removeComments | replaceAllGitHubUsernames}}
238245
{{- end -}}

0 commit comments

Comments
 (0)