ci add comment_summary
output
#9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: TF Tests | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize, closed] | |
jobs: | |
tests: | |
name: TF 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" |