Skip to content

Commit 3ec9e24

Browse files
committed
Add support for ephemeral variables in terraform >= 1.10.0
These must be specified again when applying a saved plan, but must not be specified in earlier versions of Terraform or OpenTofu
1 parent 7dfded8 commit 3ec9e24

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/workflows/test-apply.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1480,7 +1480,7 @@ jobs:
14801480

14811481
- name: Apply using explicit ephemeral value
14821482
uses: ./terraform-apply
1483-
id: apply
1483+
id: apply2
14841484
with:
14851485
label: test-apply ephemeral 2
14861486
path: tests/workflows/test-apply/ephemeral
@@ -1490,7 +1490,7 @@ jobs:
14901490

14911491
- name: Verify outputs
14921492
env:
1493-
OUTPUT_STRING: ${{ steps.apply.outputs.v }}
1493+
OUTPUT_STRING: ${{ steps.apply2.outputs.v }}
14941494
run: |
14951495
if [[ "$OUTPUT_STRING" != "hello" ]]; then
14961496
echo "::error:: output s not set correctly"
@@ -1511,7 +1511,7 @@ jobs:
15111511
- name: Apply using mismatched explicit non-ephemeral value
15121512
uses: ./terraform-apply
15131513
continue-on-error: true
1514-
id: apply
1514+
id: apply3
15151515
with:
15161516
label: test-apply ephemeral 3
15171517
path: tests/workflows/test-apply/ephemeral
@@ -1521,7 +1521,7 @@ jobs:
15211521

15221522
- name: Check failed to apply
15231523
env:
1524-
OUTCOME: ${{ steps.apply.outcome }}
1524+
OUTCOME: ${{ steps.apply3.outcome }}
15251525
run: |
15261526
if [[ "$OUTCOME" != "failure" ]]; then
15271527
echo "Apply did not fail correctly"

image/actions.sh

+2
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@ function set-plan-args() {
400400

401401
function set-remote-plan-args() {
402402
set-common-plan-args
403+
VARIABLE_ARGS=""
404+
DEPRECATED_VAR_ARGS=""
403405

404406
local AUTO_TFVARS_COUNTER=0
405407

0 commit comments

Comments
 (0)