-
-
Notifications
You must be signed in to change notification settings - Fork 160
63 lines (54 loc) · 1.47 KB
/
test-check.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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