Skip to content

Commit

Permalink
Update ci.yml
Browse files Browse the repository at this point in the history
Reformatting
  • Loading branch information
AdmiraalA authored Apr 2, 2024
1 parent 8ea3593 commit a034dfc
Showing 1 changed file with 30 additions and 29 deletions.
59 changes: 30 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,35 +44,36 @@ jobs:
with:
plan: ${{ fromJSON(steps.plan-run.outputs.payload).data.relationships.plan.data.id }}

- name: Update Pull Request
uses: actions/github-script@v7
with:
github-token: ${{ secrets.USER_TOKEN }}
script: |
const output = `#### Terraform Format and Style <img draggable="false" role="img" class="emoji" alt="🖌" src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/svg/1f58c.svg">\`${{ steps.fmt.outcome }}\`
#### Terraform Initialization <img draggable="false" role="img" class="emoji" alt="🤖" src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/svg/1f916.svg">\`${{ steps.init.outcome }}\`
#### Terraform Validation <img draggable="false" role="img" class="emoji" alt="🤖" src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/svg/1f916.svg">\`${{ steps.validate.outcome }}\`
#### Terraform Plan <img draggable="false" role="img" class="emoji" alt="📖" src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/svg/1f4d6.svg">\`${{ steps.plan.outcome }}\`
<details><summary>Show Plan</summary>
\`\`\`\n
${{ steps.plan.outputs.stdout }}
\`\`\`

</details>

*Pushed by: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;

github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})
- name: Terraform Plan Status
if: steps.plan.outcome == 'failure'
run: exit 1

- name: Update Pull Request
uses: actions/github-script@v7
with:
github-token: ${{ secrets.USER_TOKEN }}
script: |
const output = `#### Terraform Format and Style <img draggable="false" role="img" class="emoji" alt="🖌" src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/svg/1f58c.svg">\`${{ steps.fmt.outcome }}\`
#### Terraform Initialization <img draggable="false" role="img" class="emoji" alt="🤖" src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/svg/1f916.svg">\`${{ steps.init.outcome }}\`
#### Terraform Validation <img draggable="false" role="img" class="emoji" alt="🤖" src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/svg/1f916.svg">\`${{ steps.validate.outcome }}\`
#### Terraform Plan <img draggable="false" role="img" class="emoji" alt="📖" src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/svg/1f4d6.svg">\`${{ steps.plan.outcome }}\`
<details><summary>Show Plan</summary>
\`\`\`\n
${{ steps.plan.outputs.stdout }}
\`\`\`

</details>

*Pushed by: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;

github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})

- name: Terraform Plan Status
if: steps.plan.outcome == 'failure'
run: exit 1

- name: Terraform Apply
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: terraform apply -auto-approve

0 comments on commit a034dfc

Please sign in to comment.