Skip to content

Commit

Permalink
Update terraform_plan.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
arnol377 committed Aug 15, 2024
1 parent 59045e1 commit 99e2f93
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions .github/workflows/terraform_plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,27 +89,24 @@ jobs:
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
const plan=${process.env.PLAN};
const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\`
#### Terraform Plan ID: \`${{ github.sha }}\`
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
#### Terraform Validation 🤖\`${{ steps.validate.outcome }}\`;
#### Terraform Validation 🤖\`${{ steps.validate.outcome }}\`
<details><summary>Validation Output</summary>
\`\`\`\n
${{ steps.validate.outputs.stdout }}
\`\`\`
</details>
#### Terraform Plan ID: \`${{ github.sha }}\`
#### Terraform Plan 📖\`${{ steps.plan.outcome }}\`
<details><summary>Plan</summary>
\`${ env.terraform_plan }\`
</details>
*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 }}
})

0 comments on commit 99e2f93

Please sign in to comment.