diff --git a/src/gitlab-tofu.sh b/src/gitlab-tofu.sh index 5ffb0a14e3e6d46d37418b870f5d4ee05af55497..4daa0d424e6fe9957ffae555b7cc92c62225598c 100644 --- a/src/gitlab-tofu.sh +++ b/src/gitlab-tofu.sh @@ -15,10 +15,6 @@ if [ -z "$TF_FF_AUTO_URLENCODE_STATE_NAME" ]; then TF_FF_AUTO_URLENCODE_STATE_NAME=true fi -if [ -z "$TF_FF_AUTO_APPROVE_APPLY" ]; then - TF_FF_AUTO_APPROVE_APPLY=true -fi - # Helpers # Evaluate if this script is being sourced or executed directly. @@ -211,17 +207,12 @@ if [ $sourced -eq 0 ]; then case "${1}" in "apply") - auto_approve_args="" - if [ "${TF_FF_AUTO_APPROVE_APPLY}" = true ]; then - auto_approve_args="-auto-approve" - fi - $TF_IMPLICIT_INIT && terraform_init if [ "$TF_APPLY_NO_PLAN" = false ]; then - tofu "${TF_CHDIR_OPT}" "${@}" -input=false "${auto_approve_args}" "${TF_PLAN_CACHE}" + tofu "${TF_CHDIR_OPT}" "${@}" -input=false -auto-approve "${TF_PLAN_CACHE}" else # shellcheck disable=SC2086 - tofu "${TF_CHDIR_OPT}" "${@}" -input=false "${auto_approve_args}" ${var_file_args} + tofu "${TF_CHDIR_OPT}" "${@}" -input=false -auto-approve ${var_file_args} fi ;; "destroy")