From a1e48006b99d85b7c1dea1f19c86cbab82cc8b5a Mon Sep 17 00:00:00 2001 From: Dennis Alund Date: Thu, 19 Sep 2024 15:29:35 +0800 Subject: [PATCH] Updating handling of environment variables Seems like line breaks are sneaking in --- .github/workflows/configure_apphosting.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/configure_apphosting.yml b/.github/workflows/configure_apphosting.yml index f1ee9609..096fdc17 100644 --- a/.github/workflows/configure_apphosting.yml +++ b/.github/workflows/configure_apphosting.yml @@ -48,12 +48,12 @@ jobs: id: load_env run: | echo "${{ secrets.APP_CMS_DOT_ENV }}" > apps/cms/.env - value=$(grep -m 1 "${{ matrix.config.variable }}" apps/cms/.env | cut -d '=' -f 2 || true) - if [ -z "$value" ]; then + source apps/cms/.env + if [ -z "${{ matrix.config.variable }}" ]; then echo "Environment variable ${{ matrix.config.variable }} is missing in the .env file!" exit 1 fi - echo "CONFIG_VALUE=$value" >> $GITHUB_ENV + echo "CONFIG_VALUE=${!matrix.config.variable}" | tr -d '[:space:]' >> $GITHUB_ENV shell: bash - name: Save current value to a file