From 8dfaafed8729ca20c0b3f159d537a415114981e9 Mon Sep 17 00:00:00 2001 From: Uzaeir Khan Date: Mon, 13 Nov 2023 12:48:22 +0100 Subject: [PATCH] BC-5468 update after review --- .github/workflows/main.yml | 10 +++++----- cypress.config.js | 7 ++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f0cfd808..06e137ee 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -87,6 +87,8 @@ jobs: environment="dev" fi + file_paths=() + for instance in "${instances[@]}"; do if [[ $workflow_name == *"manual"* || $workflow_name == *"remote"* ]]; then file_path="${{ github.workspace }}/e2e-system-tests/env_variables/file-${environment}-${instance}.json" @@ -94,13 +96,11 @@ jobs: file_path="${{ github.workspace }}/e2e-system-tests/env_variables/file-dev-${instance}.json" fi - while IFS="=" read -r key value; do - echo "Setting $key" - echo "::add-mask::$value" - echo "$key=$value" >> $GITHUB_ENV - done < <(jq -r 'to_entries | .[] | .key + "=" + .value' "$file_path") + file_paths+=("$file_path") done + cat "${file_paths[@]}" > ${{ github.workspace }}/e2e-system-tests/env_variables/combined_credentials.env.json + - name: Clean up previous report uses: cypress-io/github-action@v5 with: diff --git a/cypress.config.js b/cypress.config.js index d51fc8aa..9ac31fe1 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -5,8 +5,13 @@ const preprocessor = require('@badeball/cypress-cucumber-preprocessor') async function setupNodeEvents (on, config) { const isCI = config.env.environmentName === 'ci' if (isCI) { + const environmentFilename = `./env_variables/combined_credentials.env.json` + console.log('loading %s', environmentFilename) + const settings = require(environmentFilename) + config.env = { - ...config.env + ...config.env, + ...settings } } else { const environmentName = config.env.environmentName || 'local'