diff --git a/.github/workflows/terraform_plan.yaml b/.github/workflows/terraform_plan.yaml
index 256518c..cf814d4 100644
--- a/.github/workflows/terraform_plan.yaml
+++ b/.github/workflows/terraform_plan.yaml
@@ -81,7 +81,7 @@ jobs:
if: github.event_name == 'pull_request'
run: echo terraform_plan=$(terraform show -no-color ${{ vars.plan_cache }}/${{ github.sha }}) >> $GITHUB_ENV
- - name: Post Terraform Plan to PR
+ - name: Post Terraform Stats to PR
uses: CSVD/gh-actions-github-script@v6
if: github.event_name == 'pull_request'
env:
@@ -93,29 +93,23 @@ jobs:
#### Terraform Plan ID: \`${{ github.sha }}\`
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
#### Terraform Validation 🤖\`${{ steps.validate.outcome }}\`
- Validation Output
-
- \`\`\`\n
- ${{ steps.validate.outputs.stdout }}
- \`\`\`
-
-
-
- #### Terraform Plan 📖\`${{ steps.plan.outcome }}\`
-
- Show Plan
-
- \`\`\`\n
- ${process.env.PLAN}
- \`\`\`
-
-
-
- *Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Workflow: \`${{ github.workflow }}\`*`;
-
+
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})
+
+ - name: Post Terraform Plan to PR
+ uses: CSVD/gh-actions-github-script@v6
+ if: github.event_name == 'pull_request'
+ with:
+ github-token: ${{ secrets.GH_TOKEN }}
+ script: |
+ github.rest.issues.createComment({
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ body: ${{ env.terraform_plan }}
+ })