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 2106496 commit c1885bf
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion .github/workflows/terraform_plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ jobs:

- uses: CSVD/gh-actions-setup-terraform@v2
with:
terraform_wrapper: false
terraform_version: ${{ vars.terraform_version }}

- name: Terraform Format
Expand All @@ -56,3 +55,40 @@ jobs:
id: plan
run: terraform plan
continue-on-error: true

- uses: CSVD/gh-actions-github-script@v7
if: github.event_name == 'pull_request'
env:
PLAN: "terraform\n${{ steps.plan.outputs.stdout }}"
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\`
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
#### Terraform Validation 🤖\`${{ steps.validate.outcome }}\`
<details><summary>Validation Output</summary>
\`\`\`\n
${{ steps.validate.outputs.stdout }}
\`\`\`
</details>
#### Terraform Plan 📖\`${{ steps.plan.outcome }}\`
<details><summary>Show Plan</summary>
\`\`\`\n
${process.env.PLAN}
\`\`\`
</details>
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Working Directory: \`${{ env.tf_actions_working_dir }}\`, Workflow: \`${{ github.workflow }}\`*`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})

0 comments on commit c1885bf

Please sign in to comment.