From 41789f6ccacdc0cb18fcdafa3d94396632faf328 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 23 Oct 2025 13:27:06 -0400 Subject: [PATCH] GITHUB_ENV --- .gitea/workflows/auto-pr-tofu-plan.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/auto-pr-tofu-plan.yml b/.gitea/workflows/auto-pr-tofu-plan.yml index 0921fdf..03df416 100644 --- a/.gitea/workflows/auto-pr-tofu-plan.yml +++ b/.gitea/workflows/auto-pr-tofu-plan.yml @@ -103,10 +103,27 @@ jobs: HC_VAULT_SECRETS_PATH: tar-valon-terraform/env ENV_FILE_NAME: cloudflare/.env + - name: Export env vars from Vault .env + run: | + echo "🧩 Cleaning and loading cloudflare/.env into GitHub Actions environment..." + + # 1️⃣ Strip any single or double quotes from the file to avoid invalid URIs or extra quoting + sed -i 's/[\"'\'']//g' cloudflare/.env + + # 2️⃣ Load all vars into current shell + set -a + source cloudflare/.env + set +a + + # 3️⃣ Export to GitHub Actions environment + while IFS='=' read -r key value; do + if [[ -n "$key" ]]; then + echo "$key=$value" >> $GITHUB_ENV + fi + done < cloudflare/.env + - name: Run tofu init uses: dnogu/tofu-init@v1 - env: - AWS_REGION: ${AWS_DEFAULT_REGION} with: working-directory: . chdir: cloudflare