GITHUB_ENV
This commit is contained in:
@@ -103,10 +103,27 @@ jobs:
|
|||||||
HC_VAULT_SECRETS_PATH: tar-valon-terraform/env
|
HC_VAULT_SECRETS_PATH: tar-valon-terraform/env
|
||||||
ENV_FILE_NAME: cloudflare/.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
|
- name: Run tofu init
|
||||||
uses: dnogu/tofu-init@v1
|
uses: dnogu/tofu-init@v1
|
||||||
env:
|
|
||||||
AWS_REGION: ${AWS_DEFAULT_REGION}
|
|
||||||
with:
|
with:
|
||||||
working-directory: .
|
working-directory: .
|
||||||
chdir: cloudflare
|
chdir: cloudflare
|
||||||
|
|||||||
Reference in New Issue
Block a user