-
Notifications
You must be signed in to change notification settings - Fork 180
/
.tfcmt.yaml
141 lines (124 loc) · 4.49 KB
/
.tfcmt.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# Configuration file for tfcmt tool used to run terraform commands and post results to github.
# plan_patch option enables patching existing tfcmt comments instead of creating new ones.
# This is useful when you want to keep the comment history clean. This option is valid for the tfcmt plan command only.
# Setting it in configuration file instead of a command line argument will make it default for all plan commands without
# need to define separate arguments list for the apply command. This makes the tekton terraform-executor task definition simpler and more readable.
plan_patch: true
embedded_var_names: []
ci:
pr: []
owner: []
repo: []
sha: []
link: []
vars: {}
templates:
plan_title: "## {{if eq .ExitCode 1}}:x: {{end}}Plan Result{{if .Vars.target}} ({{.Vars.target}}){{end}}"
apply_title: "## :{{if eq .ExitCode 0}}white_check_mark{{else}}x{{end}}: Apply Result{{if .Vars.target}} ({{.Vars.target}}){{end}}"
result: "{{if .Result}}<pre><code>{{ .Result }}</code></pre>{{end}}"
updated_resources: |
{{if .CreatedResources}}
* Create
{{- range .CreatedResources}}
* {{avoidHTMLEscape .}}
{{- end}}{{end}}{{if .UpdatedResources}}
* Update
{{- range .UpdatedResources}}
* {{avoidHTMLEscape .}}
{{- end}}{{end}}{{if .DeletedResources}}
* Delete
{{- range .DeletedResources}}
* {{avoidHTMLEscape .}}
{{- end}}{{end}}{{if .ReplacedResources}}
* Replace
{{- range .ReplacedResources}}
* {{avoidHTMLEscape .}}
{{- end}}{{end}}
deletion_warning: |
{{if .HasDestroy}}
### :warning: Resource Deletion will happen :warning:
This plan contains resource delete operation. Please check the plan result very carefully!
{{end}}
changed_result: |
{{if .ChangedResult}}
<details><summary>Change Result (Click me)</summary>
{{wrapCode .ChangedResult}}
</details>
{{end}}
change_outside_terraform: |
{{if .ChangeOutsideTerraform}}
<details><summary>:information_source: Objects have changed outside of Terraform</summary>
_This feature was introduced from [Terraform v0.15.4](https://github.com/hashicorp/terraform/releases/tag/v0.15.4)._
{{wrapCode .ChangeOutsideTerraform}}
</details>
{{end}}
warning: |
{{if .Warning}}
## :warning: Warnings :warning:
{{wrapCode .Warning}}
{{end}}
error_messages: |
{{if .ErrorMessages}}
## :warning: Errors
{{range .ErrorMessages}}
* {{. -}}
{{- end}}{{end}}
guide_apply_failure: ""
guide_apply_parse_error: ""
terraform:
plan:
disable_label: false
template: |
{{template "plan_title" .}}
{{if .Link}}[CI link]({{.Link}}){{end}}
{{template "deletion_warning" .}}
{{template "result" .}}
{{template "updated_resources" .}}
{{template "changed_result" .}}
{{template "change_outside_terraform" .}}
{{template "warning" .}}
{{template "error_messages" .}}
when_add_or_update_only:
label: "{{if .Vars.target}}{{.Vars.target}}/{{end}}add-or-update"
label_color: 1d76db # blue
# disable_label: false
when_destroy:
label: "{{if .Vars.target}}{{.Vars.target}}/{{end}}destroy"
label_color: d93f0b # red
# disable_label: false
when_no_changes:
label: "{{if .Vars.target}}{{.Vars.target}}/{{end}}no-changes"
label_color: 0e8a16 # green
# disable_label: false
# disable_comment: false
when_plan_error:
label:
label_color:
# disable_label: false
when_parse_error:
template: |
{{template "plan_title" .}}
{{if .Link}}[CI link]({{.Link}}){{end}}
It failed to parse the result.
<details><summary>Details (Click me)</summary>
{{wrapCode .CombinedOutput}}
</details>
apply:
template: |
{{template "apply_title" .}}
{{if .Link}}[CI link]({{.Link}}){{end}}
{{if ne .ExitCode 0}}{{template "guide_apply_failure" .}}{{end}}
{{template "result" .}}
<details><summary>Details (Click me)</summary>
{{wrapCode .CombinedOutput}}
</details>
{{template "error_messages" .}}`
when_parse_error:
template: |
{{template "apply_title" .}}
{{if .Link}}[CI link]({{.Link}}){{end}}
{{template "guide_apply_parse_error" .}}
It failed to parse the result.
<details><summary>Details (Click me)</summary>
{{wrapCode .CombinedOutput}}
</details>