diff --git a/config/config.go b/config/config.go index dbe10bb..b8fe115 100644 --- a/config/config.go +++ b/config/config.go @@ -62,10 +62,11 @@ type TypetalkNotifier struct { // Terraform represents terraform configurations type Terraform struct { - Default Default `yaml:"default"` - Fmt Fmt `yaml:"fmt"` - Plan Plan `yaml:"plan"` - Apply Apply `yaml:"apply"` + Default Default `yaml:"default"` + Fmt Fmt `yaml:"fmt"` + Plan Plan `yaml:"plan"` + Apply Apply `yaml:"apply"` + UseRawOutput bool `yaml:"use_raw_output,omitempty"` } // Default is a default setting for terraform commands diff --git a/config/config_test.go b/config/config_test.go index 880fc5a..5d37c8a 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -56,6 +56,7 @@ func TestLoadFile(t *testing.T) { Apply: Apply{ Template: "", }, + UseRawOutput: false, }, path: "../example.tfnotify.yaml", }, @@ -99,6 +100,7 @@ func TestLoadFile(t *testing.T) { Apply: Apply{ Template: "", }, + UseRawOutput: false, }, path: "../example-with-destroy.tfnotify.yaml", }, diff --git a/example-use-raw-output.tfnotify.yaml b/example-use-raw-output.tfnotify.yaml new file mode 100644 index 0000000..bf0ade8 --- /dev/null +++ b/example-use-raw-output.tfnotify.yaml @@ -0,0 +1,21 @@ +ci: circleci +notifier: + github: + token: $GITHUB_TOKEN + repository: + owner: "mercari" + name: "tfnotify" +terraform: + use_raw_output: true + plan: + template: | + {{ .Title }} + {{ .Message }} + {{if .Result}} +
{{ .Result }}
+      
+ {{end}} +
Details (Click me) + +
{{ .Body }}
+