Skip to content

ci add comment_summary output #8

ci add comment_summary output

ci add comment_summary output #8

Workflow file for this run

---
name: TF Tests
on:
pull_request:
types: [opened, reopened, synchronize, closed]
jobs:
tests:
runs-on: ubuntu-latest
if: github.event.action != 'closed' || github.event.pull_request.merged
permissions:
actions: read # Required for workflow query and artifact download.
contents: read # Required for repository checkout.
pull-requests: write # Required for commenting on PR.
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup TF
uses: hashicorp/setup-terraform@v3
- name: Provision TF
id: tf
continue-on-error: true
uses: ./
with:
chdir_prefix: tests/
command_input: ${{ format('-tf={0} -chdir=50_pass_one', github.event.action != 'closed' && 'plan' || 'apply') }}
cache_plugins: false
# - 10_fail_invalid_resource_type
# - 11_fail_data_source_error
# - 50_pass_one
# - 51_pass_character_limit
# - 52_pass_format_diff
- name: Echo TF
if: success() || failure()
run: |
echo "command: ${{ steps.tf.outputs.command }}"
echo "comment_id: ${{ steps.tf.outputs.comment_id }}"
echo "comment_summary: ${{ steps.tf.outputs.comment_summary }}"
echo "plan_id: ${{ steps.tf.outputs.plan_id }}"
echo "tf_fmt: ${{ steps.tf.outputs.tf_fmt }}"
echo "tf_output: ${{ steps.tf.outputs.tf_output }}"
- name: Echo github-script context
if: success() || failure()
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: console.log(JSON.stringify(context, null, 2))
- name: Echo github context
if: success() || failure()
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
run: echo "$GITHUB_CONTEXT"