From 79f4e8efc6a411d2db17aa9457a515005281a109 Mon Sep 17 00:00:00 2001 From: Stephen Okpalaononuju Date: Thu, 26 Oct 2023 18:58:58 +0100 Subject: [PATCH] ch: refactor workflow for helpline-code --- .github/workflows/deploy-multiple-accounts.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-multiple-accounts.yml b/.github/workflows/deploy-multiple-accounts.yml index 7a71933c..f7ccc900 100644 --- a/.github/workflows/deploy-multiple-accounts.yml +++ b/.github/workflows/deploy-multiple-accounts.yml @@ -124,11 +124,19 @@ jobs: ssm_parameter: ${{env.TWILIO_SSM_PREFIX}}_POST_SURVEY_BOT_CHAT_URL env_variable_name: POST_SURVEY_BOT_CHAT_URL + - name: Check matrix.helpline-code and set HELPLINE_CODE + run: | + if [[ "${{ matrix.helpline_code }}" == "E2E" ]]; then + export HELPLINE_CODE="${{ matrix.helpline_code }}" + else + # Retrieve the SSM parameter and set HELPLINE_CODE + ssm_value=$(aws ssm get-parameter --name ${{ env.TWILIO_SSM_PREFIX }}_HELPLINE_CODE --query 'Parameter.Value' --output text) + export HELPLINE_CODE="${{ ssm_value }}" + fi + shell: bash + - name: Set Helpline Code - uses: marvinpinto/action-inject-ssm-secrets@latest - with: - ssm_parameter: ${{env.TWILIO_SSM_PREFIX}}_HELPLINE_CODE - env_variable_name: HELPLINE_CODE + run: echo "HELPLINE_CODE=${{ env.HELPLINE_CODE }}" >> $GITHUB_ENV - name: Set AWS credentials for Aselo user uses: marvinpinto/action-inject-ssm-secrets@latest @@ -178,7 +186,7 @@ jobs: aselo-app-secret-key: $ASELO_APP_SECRET_KEY aws-region: $HELPLINE_AWS_REGION s3-bucket: $S3_BUCKET - helpline-code: $HELPLINE_CODE + helpline-code: ${{env.HELPLINE_CODE}} environment-code: ${{matrix.environment_code}} environment: ${{env.FULL_ENVIRONMENT_NAME}} # Set 'false' if the target environment is production OR the force_enable_operating_hours override option is checked - otherwise 'true'