5353
5454 - name : Decrypt the secrets
5555 run : |
56- chmod +x ./scripts/transcrypt
57- scripts/transcrypt -c aes-256-cbc -p ${{ secrets.TRANSCRYPT }} -y
56+ bash scripts/transcrypt -c aes-256-cbc -p ${{ secrets.TRANSCRYPT }} -y
5857
5958 - uses : hashicorp/setup-terraform@v2
6059 with :
@@ -64,11 +63,11 @@ jobs:
6463
6564 - name : Setup Remote Config Backend
6665 run : |
67- cat > config.remote.tfbackend <<EOT
66+ cat > /tmp/ config.remote.tfbackend <<EOF
6867 workspaces { name = "${{ inputs.tf_workspace_name }}"}
6968 hostname = "app.terraform.io"
7069 organization = "${{ inputs.tf_organization }}"
71- EOT
70+ EOF
7271
7372 - name : Terraform fmt
7473 working-directory : ${{ inputs.project }}/${{ inputs.instance }}/${{ inputs.resource }}
@@ -78,33 +77,33 @@ jobs:
7877 - name : Terraform Init for ${{ inputs.project }}/${{ inputs.instance }}/${{ inputs.resource }}
7978 working-directory : ${{ inputs.project }}/${{ inputs.instance }}/${{ inputs.resource }}
8079 run : |
81- cat config.remote.tfbackend
82- terraform init -backend-config=config.remote.tfbackend
80+ cat /tmp/ config.remote.tfbackend
81+ terraform init -backend-config=/tmp/ config.remote.tfbackend
8382
8483 - name : Terraform Validate
8584 working-directory : ${{ inputs.project }}/${{ inputs.instance }}/${{ inputs.resource }}
8685 run : terraform validate
8786
8887 - name : Fetch and write terraform.tfvars
8988 run : |
90- echo ${{ secrets.TF_VARS_FILE }} > terraform.tfvars
91- chmod 600 terraform.tfvars
89+ echo ${{ secrets.TF_VARS_FILE }} > /tmp/ terraform.tfvars
90+ chmod 600 /tmp/ terraform.tfvars
9291
9392 - name : Terraform Plan for ${{ inputs.project }}/${{ inputs.instance }}/${{ inputs.resource }}
9493 if : ${{ (inputs.run_destroy == 'no') }}
9594 working-directory : ${{ inputs.project }}/${{ inputs.instance }}/${{ inputs.resource }}
9695 run : |
97- terraform plan -var-file=terraform.tfvars
96+ terraform plan -var-file=/tmp/ terraform.tfvars
9897
9998 - name : Terraform Apply for ${{ inputs.project }}/${{ inputs.instance }}/${{ inputs.resource }}
10099 if : ${{ (inputs.run_apply == 'yes') && (inputs.run_destroy == 'no') }}
101100 working-directory : ${{ inputs.project }}/${{ inputs.instance }}/${{ inputs.resource }}
102101 run : |
103- terraform apply -auto-approve -var-file=terraform.tfvars
102+ terraform apply -auto-approve -var-file=/tmp/ terraform.tfvars
104103
105104 - name : Terraform Destroy for ${{ inputs.project }}/${{ inputs.instance }}/${{ inputs.resource }}
106105 if : ${{ (inputs.run_destroy == 'yes') }}
107106 working-directory : ${{ inputs.project }}/${{ inputs.instance }}/${{ inputs.resource }}
108107 run : |
109- terraform plan -destroy -var-file=terraform.tfvars
110- terraform destroy -auto-approve -var-file=terraform.tfvars
108+ terraform plan -destroy -var-file=/tmp/ terraform.tfvars
109+ terraform destroy -auto-approve -var-file=/tmp/ terraform.tfvars
0 commit comments