diff --git a/.github/workflows/terraform_plan.yaml b/.github/workflows/terraform_plan.yaml
index f532292..93a4805 100644
--- a/.github/workflows/terraform_plan.yaml
+++ b/.github/workflows/terraform_plan.yaml
@@ -68,24 +68,13 @@ jobs:
- name: Terraform Plan
id: plan
- if: github.event_name == 'pull_request'
- run: terraform plan -no-color -out=${{ vars.plan_cache }}/${{ github.sha }}
- continue-on-error: true
-
- - name: Terraform Plan
- if: github.event_name != 'pull_request'
run: terraform plan -no-color
continue-on-error: true
- - name: Terraform Show plan
- if: github.event_name == 'pull_request'
- run: echo ::set-output name=terraform_plan::$(terraform show ${{ vars.plan_cache }}/${{ github.sha }})
-
- - name: Post Terraform Plan to PR
- uses: CSVD/gh-actions-github-script@v6
+ - uses: CSVD/gh-actions-github-script@v6
if: github.event_name == 'pull_request'
env:
- PLAN: "terraform\n${{ env.terraform_plan }}"
+ PLAN: "terraform\n${{ steps.plan.outputs.stdout }}"
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
@@ -93,25 +82,17 @@ jobs:
#### 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,