Skip to content

Commit

Permalink
Refactor back to checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mraerino committed Jan 6, 2024
1 parent 433836d commit b667266
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
permissions:
contents: read
pull-requests: write
statuses: write
checks: write
env:
TF_HTTP_PASSWORD: ${{ github.token }}
TF_IN_AUTOMATION: "true"
Expand Down Expand Up @@ -74,14 +74,18 @@ jobs:
const sha = context.eventName === 'pull_request'
? context.payload.after
: context.sha
await github.rest.repos.createCommitStatus({
await github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
sha,
state: 'success',
context: 'Terraform',
description: summary,
})
head_sha: sha,
status: 'completed',
conclusion: noChanges ? 'neutral' : 'success',
name: "Terraform",
output: {
title: context.eventName === 'push' ? "Apply" : "Plan",
summary,
},
});
- run: terraform show -no-color tfplan > summary.txt
if: ${{ github.event_name == 'pull_request' }}
Expand Down

0 comments on commit b667266

Please sign in to comment.