diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 095d5bb..50c5bf4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,3 +44,17 @@ jobs: - name: Terraform Plan run: terraform plan + + - name: Comment PR with Terraform Plan + if: github.event_name == 'pull_request' + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const planOutput = `### Terraform Plan\n\`\`\`\n${{ steps.plan.outputs.stdout }}\n\`\`\``; + github.rest.issues.createComment({ + issue_number: context.payload.pull_request.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: planOutput + });