atlantis: Github diff markdown formatting does not work properly for embedded YAML content
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
- Please do not leave “+1” or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
- If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Overview of the Issue
Github diff markdown formatter (added with https://github.com/runatlantis/atlantis/pull/1751) does not work properly for embedded YAML content because it incorrectly treats hyphen - symbol, used to denote an array element in YAML, as diff removal.
Reproduction Steps
Example of Terraform code:
provider "aws" {
region = "us-east-1"
}
data "template_file" "yaml_file" {
template = <<EOT
array:
- value1
- value2
EOT
}
resource "aws_api_gateway_rest_api" "rest_api" {
name = "test"
body = data.template_file.yaml_file.rendered
endpoint_configuration {
types = ["REGIONAL"]
}
}
GitHub comment created by Atlantis:

GitHub comment source:
# aws_api_gateway_rest_api.rest_api will be created
+ resource "aws_api_gateway_rest_api" "rest_api" {
+ api_key_source = (known after apply)
+ arn = (known after apply)
+ binary_media_types = (known after apply)
+ body = <<~EOT
array:
- value1
- value2
EOT
+ created_date = (known after apply)
+ description = (known after apply)
+ disable_execute_api_endpoint = (known after apply)
+ execution_arn = (known after apply)
+ id = (known after apply)
+ minimum_compression_size = -1
+ name = "test"
+ policy = (known after apply)
+ root_resource_id = (known after apply)
+ tags_all = (known after apply)
+ endpoint_configuration {
+ types = [
+ "REGIONAL",
]
+ vpc_endpoint_ids = (known after apply)
}
}
Logs
Not available.
Environment details
- Atlantis version: 0.17.4
- Atlantis flags:
ATLANTIS_ENABLE_DIFF_MARKDOWN_FORMAT=true
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 13
- Comments: 17 (10 by maintainers)
Does the github diff markdown work now for embedded YAML content ? @dyurovskykh-tivo @pauloconnor
you can send a PR if you think that is a better regex.
On Tue, Sep 27, 2022 at 12:25 AM Pepe (Jose) Amengual < @.***> wrote: