-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Github Actions Terraform output with github-script has symbols / ascii characters #207
Comments
any update, facing similar issue! |
That's why they tell you to run terraform with |
I used something like For example - run: terraform plan -out tfplan
id: plan
- run: terraform show -no-color tfplan
id: show
- uses: actions/github-script@v6
env:
PLAN: ${{ steps.show.outputs.stdout }} # <-- reference the "show" step
with:
script: |
const output = `#### Terraform Plan 📖\`${{ steps.plan.outcome }}\`
<details><summary>Show Plan</summary>
\`\`\`\n
${process.env.PLAN}
\`\`\`
</details>
*Pushed by: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})` |
this is a great work around. I am going to do something similar. Thank You! |
If i give terraform plan -out tfplan, it will save the Plan in the Self-Hosted runner and same Plan wont display in the Terraform Cloud/Enterprise plan logs. Is there any workaround to display the Plan outputs in the Terraform enterprise as well ? |
Following the example setup where the outputs of Terraform Plan is added to the Pull Request as a comment. However there's all these ? type symbols that gets added in the comments.
versions:
hashicorp/setup-terraform@v2
actions/github-script@v6
my Github Actions YML File
My condensed Output:
`
Where do these question mark symbols come from. If I set my terraform plan to -no-color it'll remove the symbols. Is there any other work around?
The text was updated successfully, but these errors were encountered: