DEV Community

Shunsuke Suzuki
Shunsuke Suzuki

Posted on

4 2

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.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay