hashicorp / setup-terraform

Sets up Terraform CLI in your GitHub Actions workflow.
https://developer.hashicorp.com/terraform/tutorials/automation/github-actions
Mozilla Public License 2.0
1.34k stars 235 forks source link

Escape backticks in stdout and stderr #402

Open manabusakai opened 4 months ago

manabusakai commented 4 months ago

Thank you for an awesome actions! 😄 fixes #401

The stdout of validate or plan may contain backticks. If backticks are included, problems like #401 will occur.

Fix this problem by escaping the backticks.

hashicorp-cla commented 4 months ago

CLA assistant check
All committers have signed the CLA.

bflad commented 4 months ago

Hi @manabusakai 👋 Thank you for submitting this.

This seems reasonable on the surface, however it is not clear whether this should be an automatic behavior of this particular GitHub Action. While you are passing the output to an action that is sensitive to particular characters, other workflows may be dependent on the existing behavior and introducing the escaping could introduce a regression. This submission does not do this, but just to mention, it also seems awkward to potentially introduce this as a configurable action option, for such a targeted use case.

While we wait for other maintainers to offer their opinions, you may want to check out other GitHub Actions that seem to implement this functionality, such as https://github.com/marketplace/actions/find-and-replace-strings. I cannot endorse this particular action as I have never used it myself, but it (or another similar action) should hopefully get the job done for your use case.

Thanks again.