- Newest
- Most votes
- Most comments
While there is no direct setting to fix the formatting, this issue typically occurs when the change set is too large for a single Bitbucket comment. To mitigate this, you can:
- Modularize your templates: Breaking large stacks into smaller, nested stacks can reduce the size of the summary table.
- Verify in Console: Use the "Change Sets" tab in the AWS CloudFormation Console for a full, correctly formatted view of the planned changes when the Bitbucket comment fails.
PS: The formatting break occurs because Bitbucket's character limit forces the comment to split, which interrupts the Markdown table structure. Since the second comment lacks the header definition, it is rendered as plain text.
Based on the available information about CloudFormation Git Sync's comment on pull request feature, there isn't a documented way to control or fix the formatting when comments are split across multiple messages in Bitbucket.
The "Enable comment on pull request" feature is designed to post a summary of stack changes through the CodeConnections service, describing the differences between the current stack configuration and proposed changes, including resources that will be added, modified, or deleted. However, the documentation doesn't address formatting issues that may occur when comments exceed length limits and are split across multiple comments in specific Git providers like Bitbucket.
This appears to be a limitation or potential bug in how CloudFormation formats continuation comments when the change summary is too large for a single comment. I'd recommend reporting this issue to AWS Support so they can investigate the formatting problem specific to Bitbucket and potentially address it in a future update. In the meantime, you may need to work with the broken formatting in the second comment or consider disabling the feature if the formatting issues significantly impact your workflow.
Sources
Enable CloudFormation to post a summary of stack changes in pull requests - AWS CloudFormation
How Git sync works with CloudFormation - AWS CloudFormation

Checking the raw content; while you are correct the multiple comments are due to when the charge set needs the comment to be split; checking the raw content for each comment then the header is present in each case. The only thing I can see that is different is the first comment has an empty line before the table while the second comment doesn't - so I suspect this might break how Bitbucket renders it:
First Comment:
Second Comment: