|
93 | 93 | |
94 | 94 | echo 'Lock id is ${{ fromJson(steps.locked-state-destroy.outputs.lock-info).ID }}' |
95 | 95 |
|
96 | | - - name: Try using locked state using terraform-destroy-workspace |
97 | | - uses: ./terraform-destroy-workspace |
98 | | - id: locked-state-destroy-workspace |
99 | | - continue-on-error: true |
100 | | - with: |
101 | | - path: tests/workflows/test-unlock-state |
102 | | - |
103 | | - - name: Check terraform-destroy-workspace state locked failure-reason |
104 | | - run: | |
105 | | - if [[ "${{ steps.locked-state-destroy-workspace.outcome }}" != "failure" ]]; then |
106 | | - echo "Apply did not fail correctly" |
107 | | - exit 1 |
108 | | - fi |
109 | | -
|
110 | | - if [[ "${{ steps.locked-state-destroy-workspace.outputs.failure-reason }}" != "state-locked" ]]; then |
111 | | - echo "::error:: failure-reason not set correctly" |
112 | | - exit 1 |
113 | | - fi |
114 | | - |
115 | | - echo '"${{ steps.locked-state-destroy-workspace.outputs.lock-info }}"' |
116 | | - |
117 | | - echo 'Lock id is ${{ fromJson(steps.locked-state-destroy-workspace.outputs.lock-info).ID }}' |
118 | | -
|
119 | 96 | - name: Unlock the state |
120 | 97 | uses: ./terraform-unlock-state |
121 | 98 | continue-on-error: true |
@@ -200,6 +177,30 @@ jobs: |
200 | 177 | |
201 | 178 | echo 'Lock id is ${{ fromJson(steps.locked-state-workspace.outputs.lock-info).ID }}' |
202 | 179 |
|
| 180 | + - name: Try using locked state using terraform-destroy-workspace |
| 181 | + uses: ./terraform-destroy-workspace |
| 182 | + id: locked-state-destroy-workspace |
| 183 | + continue-on-error: true |
| 184 | + with: |
| 185 | + path: tests/workflows/test-unlock-state |
| 186 | + workspace: hello |
| 187 | + |
| 188 | + - name: Check terraform-destroy-workspace state locked failure-reason |
| 189 | + run: | |
| 190 | + if [[ "${{ steps.locked-state-destroy-workspace.outcome }}" != "failure" ]]; then |
| 191 | + echo "Apply did not fail correctly" |
| 192 | + exit 1 |
| 193 | + fi |
| 194 | +
|
| 195 | + if [[ "${{ steps.locked-state-destroy-workspace.outputs.failure-reason }}" != "state-locked" ]]; then |
| 196 | + echo "::error:: failure-reason not set correctly" |
| 197 | + exit 1 |
| 198 | + fi |
| 199 | + |
| 200 | + echo '"${{ steps.locked-state-destroy-workspace.outputs.lock-info }}"' |
| 201 | + |
| 202 | + echo 'Lock id is ${{ fromJson(steps.locked-state-destroy-workspace.outputs.lock-info).ID }}' |
| 203 | +
|
203 | 204 | - name: Unlock the state |
204 | 205 | uses: ./terraform-unlock-state |
205 | 206 | continue-on-error: true |
|
0 commit comments