DEV Community

Shunsuke Suzuki
Shunsuke Suzuki

Posted on

tfcmt supports updating comments

image

--

image

In this post, we introduce tfcmt's new feature, updating comments instead of creating new comments.

tfcmt is a CLI tool to improve the experience of CI of Terraform.
By posting the result of terraform plan and terraform apply to GitHub Pull Requests as a comment, you can know the result quickly without browsing the CI web page.

About tfcmt, please see the document.

From tfcmt v3.2.0, tfcmt has supported updating existing comments instead of creating new comments.

This is really useful to keep Pull Request comments clean.

To use this feature, please set -patch option.

$ tfcmt plan -patch -- terraform plan -no-color
Enter fullscreen mode Exit fullscreen mode

You can also set the plan_patch field in the configuration file.

plan_patch: true
Enter fullscreen mode Exit fullscreen mode

The command line option -patch takes precedence over configuration file option plan_patch.

If you want to disable patching although plan_patch is true, please set -patch=false.

$ tfcmt plan -patch=false -- terraform plan -no-color
Enter fullscreen mode Exit fullscreen mode

If the patch flag is enabled, tfcmt finds the comment and updates it. If no comment is found, tfcmt creates a new comment.

For detail, please see the document.

Top comments (0)