From b03d4677aa69a44c05b2f76f7e8d97de0b8190a7 Mon Sep 17 00:00:00 2001 From: digorgonzola <29941279+digorgonzola@users.noreply.github.com> Date: Tue, 19 Dec 2023 21:29:12 +1100 Subject: [PATCH] deploy-development.yml: export TF_VAR variables with correct case --- .github/workflows/deploy-development.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/deploy-development.yml b/.github/workflows/deploy-development.yml index c60e3ce..4613291 100644 --- a/.github/workflows/deploy-development.yml +++ b/.github/workflows/deploy-development.yml @@ -115,6 +115,20 @@ jobs: echo "$VARS_CONTEXT" | to_envs >> $GITHUB_ENV echo "$SECRETS_CONTEXT" | to_envs >> $GITHUB_ENV + - name: Export TF_VAR variables to environment with correct case + env: + vars_json: ${{ toJSON(vars) }} + run: | + tf_vars=$(echo $vars_json | jq -r ' + . | with_entries( .key |= ascii_downcase | select(.key | startswith("tf_var"))) + | to_entries + | map("TF_VAR_\(.key| split("tf_var_")[-1])=\(.value)") |.[]') + + for var in "${tf_vars[@]}"; do + echo "$var" + echo "$var" >> $GITHUB_ENV + done + - name: Terragrunt Plan uses: gruntwork-io/terragrunt-action@v2 with: