Skip to content

Commit f4ea6bb

Browse files
authored
Merge pull request #142 from dflook/tf-1-1
Test terraform 1.1
2 parents 6fe1131 + e1acdc8 commit f4ea6bb

File tree

17 files changed

+167
-384
lines changed

17 files changed

+167
-384
lines changed

.github/workflows/test-apply.yaml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
exit 1
113113
fi
114114
115-
if [[ $(jq -r .format_version "${{ steps.apply.outputs.json_plan_path }}") != "0.2" ]]; then
115+
if [[ $(jq -r .format_version "${{ steps.apply.outputs.json_plan_path }}") != "1.0" ]]; then
116116
echo "::error:: json_plan_path not set correctly"
117117
exit 1
118118
fi
@@ -164,46 +164,46 @@ jobs:
164164

165165
- name: Apply
166166
uses: ./terraform-apply
167-
id: output
167+
id: first-apply
168168
with:
169169
path: tests/apply/changes
170170

171171
- name: Verify outputs
172172
run: |
173-
if [[ "${{ steps.output.outputs.output_string }}" != "the_string" ]]; then
173+
if [[ "${{ steps.first-apply.outputs.output_string }}" != "the_string" ]]; then
174174
echo "::error:: output s not set correctly"
175175
exit 1
176176
fi
177177
178-
if [[ $(jq -r .output_changes.output_string.actions[0] "${{ steps.output.outputs.json_plan_path }}") != "create" ]]; then
178+
if [[ $(jq -r .output_changes.output_string.actions[0] "${{ steps.first-apply.outputs.json_plan_path }}") != "create" ]]; then
179179
echo "::error:: json_plan_path not set correctly"
180180
exit 1
181181
fi
182182
183-
if ! grep -q "Terraform will perform the following actions" '${{ steps.output.outputs.text_plan_path }}'; then
183+
if ! grep -q "Terraform will perform the following actions" '${{ steps.first-apply.outputs.text_plan_path }}'; then
184184
echo "::error:: text_plan_path not set correctly"
185185
exit 1
186186
fi
187187
188188
- name: Apply
189189
uses: ./terraform-apply
190-
id: output
190+
id: second-apply
191191
with:
192192
path: tests/apply/changes
193193

194194
- name: Verify outputs
195195
run: |
196-
if [[ "${{ steps.output.outputs.output_string }}" != "the_string" ]]; then
196+
if [[ "${{ steps.second-apply.outputs.output_string }}" != "the_string" ]]; then
197197
echo "::error:: output s not set correctly"
198198
exit 1
199199
fi
200200
201-
if [[ $(jq -r .format_version "${{ steps.output.outputs.json_plan_path }}") != "0.2" ]]; then
201+
if [[ $(jq -r .format_version "${{ steps.second-apply.outputs.json_plan_path }}") != "1.0" ]]; then
202202
echo "::error:: json_plan_path not set correctly"
203203
exit 1
204204
fi
205205
206-
if ! grep -q "No changes" '${{ steps.output.outputs.text_plan_path }}'; then
206+
if ! grep -q "No changes" '${{ steps.second-apply.outputs.text_plan_path }}'; then
207207
echo "::error:: text_plan_path not set correctly"
208208
exit 1
209209
fi
@@ -511,7 +511,8 @@ jobs:
511511
exit 1
512512
fi
513513
514-
if [[ $(jq -r .format_version "${{ steps.output.outputs.json_plan_path }}") != "0.2" ]]; then
514+
cat "${{ steps.output.outputs.json_plan_path }}"
515+
if [[ $(jq -r .format_version "${{ steps.output.outputs.json_plan_path }}") != "0.1" ]]; then
515516
echo "::error:: json_plan_path not set correctly"
516517
exit 1
517518
fi
@@ -544,7 +545,7 @@ jobs:
544545
exit 1
545546
fi
546547
547-
if [[ $(jq -r .format_version "${{ steps.apply.outputs.json_plan_path }}") != "0.2" ]]; then
548+
if [[ $(jq -r .format_version "${{ steps.apply.outputs.json_plan_path }}") != "1.0" ]]; then
548549
echo "::error:: json_plan_path not set correctly"
549550
exit 1
550551
fi

0 commit comments

Comments
 (0)