Skip to content

Commit

Permalink
chore: updated terraform workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
warrenbrown committed Jul 16, 2020
1 parent 2c09b96 commit 070e660
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: terraform

on:
- pull_request

env:
working_directory: ./test
jobs:
terraform:
runs-on: ubuntu-latest
Expand All @@ -29,22 +30,28 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\`
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
#### Terraform Validation 🤖${{ steps.validate.outputs.stdout }}
#### Terraform Plan 📖\`${{ steps.plan.outcome }}\`
const tfInitStatus = ${{steps.init.outputs.exitcode == 0}} ? ':x:' : ':white_check_mark:'
const tfValidationStatus = ${{steps.validate.outputs.exitcode == 0}} ? ':x:' : ':white_check_mark:'
const tfPlanStatus = ${{steps.plan.outputs.exitcode == 0}} ? ':x:' : ':white_check_mark:'
const output = `${tfInitStatus} Terraform Initialization
${tfValidationStatus} Terraform Validation
${tfPlanStatus} Terraform Plan
<details><summary>Show Plan</summary>
\`\`\`${process.env.PLAN}\`\`\`
</details>
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Working Directory: \`${{ env.tf_actions_working_dir }}\`, Workflow: \`${{ github.workflow }}\`*`;
*User*: @${{ github.actor }}
*Action*: \`${{ github.event_name }}\`
*Working Directory*: \`${{ env.working_directory }}\`
*Workflow*: \`${{ github.workflow }}\``;
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})
})

0 comments on commit 070e660

Please sign in to comment.