This repository was archived by the owner on May 6, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 22set -e
33cd " ${TF_ACTION_WORKING_DIR:- .} "
44
5+ if [[ ! -z " $TF_ACTION_TFE_TOKEN " ]]; then
6+ cat > ~ /.terraformrc << EOF
7+ credentials "${TF_ACTION_TFE_HOSTNAME:- app.terraform.io} " {
8+ token = "$TF_ACTION_TFE_TOKEN "
9+ }
10+ EOF
11+ fi
12+
513set +e
614OUTPUT=$( sh -c " terraform init -no-color -input=false $* " 2>&1 )
715SUCCESS=$?
Original file line number Diff line number Diff line change @@ -26,8 +26,17 @@ set -e
2626
2727cd " ${TF_ACTION_WORKING_DIR:- .} "
2828
29- WORKSPACE=${TF_ACTION_WORKSPACE:- default}
30- terraform workspace select "$WORKSPACE"
29+ if [[ ! -z " $TF_ACTION_TFE_TOKEN " ]]; then
30+ cat > ~ /.terraformrc << EOF
31+ credentials "${TF_ACTION_TFE_HOSTNAME:- app.terraform.io} " {
32+ token = "$TF_ACTION_TFE_TOKEN "
33+ }
34+ EOF
35+ fi
36+
37+ if [[ ! -z " $TF_ACTION_WORKSPACE " ]] && [[ " $TF_ACTION_WORKSPACE " != " default" ]]; then
38+ terraform workspace select "$TF_ACTION_WORKSPACE"
39+ fi
3140
3241set +e
3342OUTPUT=$( sh -c " TF_IN_AUTOMATION=true terraform plan -no-color -input=false $* " 2>&1 )
Original file line number Diff line number Diff line change 22set -e
33cd " ${TF_ACTION_WORKING_DIR:- .} "
44
5- WORKSPACE=${TF_ACTION_WORKSPACE:- default}
6- terraform workspace select "$WORKSPACE"
5+ if [[ ! -z " $TF_ACTION_WORKSPACE " ]] && [[ " $TF_ACTION_WORKSPACE " != " default" ]]; then
6+ terraform workspace select "$TF_ACTION_WORKSPACE"
7+ fi
78
89set +e
910OUTPUT=$( sh -c " terraform validate -no-color $* " 2>&1 )
You can’t perform that action at this time.
0 commit comments