This repository has been archived by the owner on Aug 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.yml
62 lines (62 loc) · 2.41 KB
/
example.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
replacements:
- pattern: user1
replacement: cjimti
- pattern: root
replacement: cjimti
- pattern: Craig Johnston
replacement: cjimti
rules:
- name: Jira Issue Update
producer: Jira
contentRule:
key: webhookEvent
equals: "jira:issue_updated"
description: Jira issue update.
template: "
{{ .issue.fields.assignee.name }},
\x02\x0300ISSUE\x03\x02 📝 \x0307{{ .issue.key }}\x03
{{ if .comment }}{{ .comment.author.name }}: \x0309\"{{ printf \"%.40s\" .comment.body }}\"\x03{{ end }}
{{ range $key, $value := .changelog.items }}
{{ if eq $value.field \"status\" }}
updated from \x0307{{ $value.fromString }}\x03
to \x0304{{ $value.toString }}\x03
{{ end }}
{{ end }}
{{ $url := splitList \"/\" .issue.self }}{{ index $url 0 }}//{{ index $url 2 }}/browse/{{ .issue.key }}
cc {{ .issue.fields.reporter.name }}, {{ .user.name }}"
- name: Gitlab Merge Request
producer: Gitlab
contentRule:
key: object_kind
equals: "merge_request"
description: Gitlab merge request.
template: "
{{ range .assignees }}{{ .username }}, {{end}}
\x0304MERGE REQUEST\x03 #{{ .object_attributes.id }}
is \x0313{{ .object_attributes.state }}\x03
for \x0307{{ .project.name }}\x03 {{ .project.web_url }}/merge_requests
cc {{ .user.username }}, {{ .object_attributes.last_commit.author.name }}"
- name: Gitlab Push
producer: Gitlab
contentRule:
key: object_kind
equals: "push"
description: Gitlab push event.
template: "
{{ .user_username }},
\x0311PUSHED\x03 \x0308{{ .commits | len }}\x03 commits
to \x0313{{ .ref }}\x03
for \x0307{{ .repository.name }}\x03 {{ .repository.homepage }}/commits/{{ .ref | splitList \"/\" | last }}
cc {{ with last $.commits }}{{ .author.name }}{{ end }}"
- name: Gitlab Pipeline Event
producer: Gitlab
contentRule:
key: object_kind
equals: "pipeline"
description: Gitlab pipeline event.
template: "
{{ .user.username }},
\x0311PIPELINE\x03 #{{ .object_attributes.id }}
is \x0313{{ .object_attributes.status }}\x03
for \x0307{{ .project.name }}\x03 {{ .project.web_url }}/pipelines/{{ .object_attributes.id }}
cc {{ .commit.author.name }}"