From 08d2b8ab4bc0bdc58ea27bae4bc9267471a29a03 Mon Sep 17 00:00:00 2001 From: Alexander Lyon Date: Thu, 26 Nov 2020 10:55:24 +0000 Subject: [PATCH] Update README.md example to fix escaping issues. Sometimes (on later versions of terraform) terraform will output warnings regarding templating which include the ${} pattern. In a template, the contents are interpreted as js which will almost always fail. --- README.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a2f3223..160328f 100644 --- a/README.md +++ b/README.md @@ -113,15 +113,25 @@ steps: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | + const validate = ${{ toJson(steps.validate.outputs.stdout) }}; + const plan = ${{ toJson(steps.plan.outputs.stdout) }}; + const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\` #### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\` - #### Terraform Validation 🤖${{ steps.validate.outputs.stdout }} + #### Terraform Validation 🤖\`${{ steps.validate.outcome }}\` + +
Show Validation + + \`\`\`${validate}\`\`\` + +
+ #### Terraform Plan 📖\`${{ steps.plan.outcome }}\` - +
Show Plan - - \`\`\`${process.env.PLAN}\`\`\` - + + \`\`\`terraform\n${plan}\`\`\` +
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Working Directory: \`${{ env.tf_actions_working_dir }}\`, Workflow: \`${{ github.workflow }}\`*`;