Skip to content

Commit 95f563c

Browse files
author
Andre Kardec
committed
feat(tf-plan-comment): revert v1 version
Related to CORE-3303
1 parent d1b3585 commit 95f563c

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

tf-plan-comment/action.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Terraform Plan Comment
22
description: Create a terraform plan comment in the PR
33
inputs:
4-
terraform_plan_file:
5-
description: The path to the file containing the contents of the terraform plan
4+
terraform_plan:
5+
description: The contents of the terraform plan
66
required: true
77
terraform_environment:
88
description: Terraform environment
@@ -13,21 +13,20 @@ runs:
1313
steps:
1414
- name: Comment on PR
1515
uses: actions/github-script@v6
16+
env:
17+
PLAN: "${{ inputs.terraform_plan }}"
1618
with:
1719
script: |
18-
const fs = require('fs');
1920
const CODE_BLOCK = '```';
20-
const planPath = '${{ inputs.terraform_plan_file }}';
21-
const planContents = fs.readFileSync(planPath, 'utf8');
2221
2322
const output = `
24-
### Terraform Plan for ${{ inputs.terraform_environment }} 🔍
23+
### Terraform Plan ${{ inputs.terraform_environment }} 🔍
2524
<details>
26-
<summary>Click to view plan details</summary>
25+
<summary>Logs</summary>
2726
28-
${CODE_BLOCK}terraform
29-
${planContents}
30-
${CODE_BLOCK}
27+
${ CODE_BLOCK }terraform
28+
${ process.env.PLAN }
29+
${ CODE_BLOCK }
3130
</details>
3231
3332
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Workflow: \`${{ github.workflow }}\`*

0 commit comments

Comments
 (0)