borchero / terraform-plan-comment

GitHub Action to post the output of "terraform plan" to a pull request comment.
MIT License
75 stars 12 forks source link

Lines in mult-line properties starting with whitespace and dash classified as deletions #6

Open stempler opened 6 months ago

stempler commented 6 months ago

First of all thanks a lot for creating this nice action! It's a very nice representation of the plan.

I gave it a try today with a case where a resource is added that includes YAML as one of its properties. It seems that when a line starts with (optional?) whitespace and a dash, like in this case for lists in YAML, the representation in the comment is rendered as deletion although it is just part of the resource property.

Example in created comment:

image

Same in original plan:

image

borchero commented 6 months ago

Uh, interesting case, thanks a lot for surfacing! I'll think about how to fix this, I hadn't dealt with plain YAML files in Terraform yet :eyes:

stempler commented 6 months ago

Here another example where there is an update to a similar property:

image

Same excerpt from original plan:

image

borchero commented 6 months ago

Yup, all boils down to the same issue! It should be possible to reverse-engineer this, the relevant information should be available :eyes: