Early eval #683
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: Test terraform-check | |
on: | |
- pull_request | |
permissions: | |
contents: read | |
jobs: | |
no_changes: | |
runs-on: ubuntu-24.04 | |
name: No changes | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Check | |
uses: ./terraform-check | |
id: check | |
with: | |
path: tests/workflows/test-check/no_changes | |
- name: Check failure-reason | |
env: | |
FAILURE_REASON: ${{ steps.check.outputs.failure-reason }} | |
run: | | |
if [[ "$FAILURE_REASON" != "" ]]; then | |
echo "::error:: failure-reason not set correctly" | |
exit 1 | |
fi | |
plan_change_comment: | |
runs-on: ubuntu-24.04 | |
name: Changes | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Check | |
uses: ./terraform-check | |
continue-on-error: true | |
id: check | |
with: | |
path: tests/workflows/test-check/changes | |
- name: Check failure-reason | |
env: | |
OUTCOME: ${{ steps.check.outcome }} | |
FAILURE_REASON: ${{ steps.check.outputs.failure-reason }} | |
run: | | |
if [[ "$OUTCOME" != "failure" ]]; then | |
echo "Check did not fail correctly" | |
exit 1 | |
fi | |
if [[ "$FAILURE_REASON" != "changes-to-apply" ]]; then | |
echo "::error:: failure-reason not set correctly" | |
exit 1 | |
fi |