File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 8
8
init-backend-workspace
9
9
set-plan-args
10
10
11
+ AUTO_APPROVE=" -auto-approve"
11
12
PLAN_OUT=" $STEP_TMP_DIR /plan.out"
12
13
13
14
function update_comment() {
@@ -29,10 +30,17 @@ function apply() {
29
30
30
31
set +e
31
32
if [[ -n " $PLAN_OUT " ]]; then
33
+
34
+ if [[ " $TERRAFORM_BACKEND_TYPE " == " cloud" ]]; then
35
+ # Using the auto approve flag when applying a saved remote plan makes terraform hang
36
+ # It does not prompt for approval anyway
37
+ AUTO_APPROVE=" "
38
+ fi
39
+
32
40
# shellcheck disable=SC2086
33
- debug_log $TOOL_COMMAND_NAME apply -input=false -no-color -auto-approve -lock-timeout=300s $PARALLEL_ARG $PLAN_OUT
41
+ debug_log $TOOL_COMMAND_NAME apply -input=false -no-color $AUTO_APPROVE -lock-timeout=300s $PARALLEL_ARG $PLAN_OUT
34
42
# shellcheck disable=SC2086
35
- (cd " $INPUT_PATH " && $TOOL_COMMAND_NAME apply -input=false -no-color -auto-approve -lock-timeout=300s $PARALLEL_ARG $PLAN_OUT ) \
43
+ (cd " $INPUT_PATH " && $TOOL_COMMAND_NAME apply -input=false -no-color $AUTO_APPROVE -lock-timeout=300s $PARALLEL_ARG $PLAN_OUT ) \
36
44
2> " $STEP_TMP_DIR /terraform_apply.stderr" \
37
45
| $TFMASK
38
46
APPLY_EXIT=${PIPESTATUS[0]}
You can’t perform that action at this time.
0 commit comments