dineshba/tf-summarize

Markdown table format is not compatible with github/gitlab

Closed this issue · 2 comments

Hey all, fantastic tool, requesting a small change / improvement, to be able to integrate this in CI pipelines, and summarize the output nicely.

Currently, it seems that the markdown table is using an old markdown syntax.

❯ tf-summarize -out=summary.md tfplan 
Written plan summary to summary.md

renders the below, escaping in backticks

Current

+--------+------------------------------------------+
| CHANGE |                   NAME                   |
+--------+------------------------------------------+
| update | module.ec2_instance.aws_instance.this[0] |
+--------+------------------------------------------+

In rendered markdown in github, this yields

+--------+------------------------------------------+
| CHANGE | NAME |
+--------+------------------------------------------+
| update | module.ec2_instance.aws_instance.this[0] |
+--------+------------------------------------------+

In a gitlab comment this would be

image

This is clearly not as it should be however if it's changed to:

Expected

| CHANGE |                   NAME                   |
|--------|------------------------------------------|
| update | module.ec2_instance.aws_instance.this[0] |

it renders as expected

CHANGE NAME
update module.ec2_instance.aws_instance.this[0]

and

image

References

Hi @stv-io, Thanks for trying out the tool.

For markdown output, you have to add -md flag

❯ tf-summarize -md -out=summary.md tfplan 

Please try it and let us know if you have any issue with the output

sorry, seems like I should have RTFM'd, indeed it works, thank you 🙇🏼

tf-summarize -md -out=summary.md tfplan
Written plan summary to summary.md

tf-project-example/sharedcat summary.md
| CHANGE |                    NAME                    |
|--------|--------------------------------------------|
| update | `module.ec2_instance.aws_instance.this[0]` |
CHANGE NAME
update module.ec2_instance.aws_instance.this[0]