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 88init-backend-workspace
99set-plan-args
1010
11+ AUTO_APPROVE=" -auto-approve"
1112PLAN_OUT=" $STEP_TMP_DIR /plan.out"
1213
1314function update_comment() {
@@ -29,10 +30,17 @@ function apply() {
2930
3031 set +e
3132 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+
3240 # 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
3442 # 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 ) \
3644 2> " $STEP_TMP_DIR /terraform_apply.stderr" \
3745 | $TFMASK
3846 APPLY_EXIT=${PIPESTATUS[0]}
You can’t perform that action at this time.
0 commit comments