This repository has been archived by the owner on Dec 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config-sample.yaml
47 lines (37 loc) · 1.86 KB
/
config-sample.yaml
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
- wechat_hook: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx
config:
- event: Issue Hook
type: markdown
content: |
<font color="info">提示</font>: @{{.User.Username}} 在{{.Project.Name}} 项目里更新了一个 Issue {{ if .Assignees }}并分配给了 {{range .Assignees}} @{{.Name}} ! {{end}}{{end}}
> <font color="comment">标题</font>: {{.ObjectAttributes.Title}}
> <font color="comment">内容</font>: {{ $length := len .ObjectAttributes.Description }} {{ if gt $length 50 }} {{slice .ObjectAttributes.Description 0 50}}...{{else}}{{.ObjectAttributes.Description}}{{end}}
> <font color="comment">状态</font>: {{.ObjectAttributes.State}}
[详细信息]({{.ObjectAttributes.URL}})
- event: Pipeline Hook
type: markdown
content: |
<font color="warning">警告</font>: {{.Project.Name}} pipeline 构建失败!
> <font color="comment">分支</font>: {{.ObjectAttributes.Ref}}
> <font color="comment">耗时</font>: {{.ObjectAttributes.Duration}} 秒
> <font color="comment">状态</font>: {{.ObjectAttributes.Status}}
[详细信息]({{.Project.WebURL}}/pipelines/)
- event: AlertManager Hook
type: markdown
content: |
{{if eq .Status "firing"}}<font color="warning">警告</font>:**{{ len .Alerts }}** 个报警正在触发中 {{else}}<font color="info">提示</font>: 报警已恢复{{end}}
<font color="comment">Labels</font>:
{{range .Alerts}}
{{if .Labels}}
{{range $key, $value := .Labels}}
> {{$key}}={{$value}}
{{end}}
{{end}}
{{if .Annotations}}
<font color="comment">Annotations</font>:
{{range $key, $value := .Annotations}}
> {{$key}}={{$value}}
{{end}}
{{end}}
{{end}}
[详细信息]({{.ExternalURL}})