Skip to content

Commit

Permalink
feat: improve default template
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Jan 28, 2021
1 parent fea583e commit 55bbda4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions terraform/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ func (t *Template) Execute() (string, error) {
}

templates := map[string]string{
"plan_title": "## Plan Result{{if .Vars.target}} ({{.Vars.target}}){{end}}",
"apply_title": "## Apply Result{{if .Vars.target}} ({{.Vars.target}}){{end}}",
"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
Expand Down
12 changes: 6 additions & 6 deletions terraform/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ func TestApplyTemplateExecute(t *testing.T) {
template: DefaultApplyTemplate,
value: CommonTemplate{},
resp: `
## Apply Result
## :white_check_mark: Apply Result
[CI link]()
Expand All @@ -376,7 +376,7 @@ func TestApplyTemplateExecute(t *testing.T) {
CombinedOutput: "body",
},
resp: `
## Apply Result
## :white_check_mark: Apply Result
[CI link]()
Expand All @@ -399,7 +399,7 @@ body
CombinedOutput: "body",
},
resp: `
## Apply Result
## :white_check_mark: Apply Result
[CI link]()
Expand All @@ -422,7 +422,7 @@ body
CombinedOutput: "body",
},
resp: `
## Apply Result
## :white_check_mark: Apply Result
[CI link]()
Expand All @@ -445,7 +445,7 @@ body
CombinedOutput: `This is a "body".`,
},
resp: `
## Apply Result
## :white_check_mark: Apply Result
[CI link]()
Expand All @@ -469,7 +469,7 @@ This is a "body".
UseRawOutput: true,
},
resp: `
## Apply Result
## :white_check_mark: Apply Result
[CI link]()
Expand Down

0 comments on commit 55bbda4

Please sign in to comment.