Skip to main content

Configuring tfcmt

The PR comments for terraform plan and apply are generated by tfcmt. For details on tfcmt configuration, refer to the tfcmt documentation.

https://suzuki-shunsuke.github.io/tfcmt/config

tfcmt works well without any configuration, but here are a few commonly used settings.

Disabling Labels

terraform:
plan:
disable_label: false

Changing Label Suffix and Color

terraform:
plan:
when_add_or_update_only:
label: "{{if .Vars.target}}{{.Vars.target}}/{{end}}update"
label_color: 1d76db # blue
when_destroy:
label: "{{if .Vars.target}}{{.Vars.target}}/{{end}}delete"
label_color: d93f0b # red
when_no_changes:
label: "{{if .Vars.target}}{{.Vars.target}}/{{end}}nop"
label_color: 0e8a16 # green

Skipping Comments When There Are No Changes

terraform:
plan:
when_no_changes:
disable_comment: true

Updating an Existing Comment Instead of Posting a New One

plan_patch: true