From 3b23cdcf71b68087c8df8e3187744bc54b9357bd Mon Sep 17 00:00:00 2001 From: Michele Mancioppi Date: Wed, 8 Nov 2023 10:49:22 +0100 Subject: [PATCH] fix: reference of access keys between CI jobs --- .github/workflows/ci.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 525f0da8..caaddb7b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -56,6 +56,7 @@ jobs: validation_api_apigateway_name: ${{ steps.parse_cdk_output.outputs.api_gateway_name }} validation_api_apigateway_url: ${{ steps.parse_cdk_output.outputs.api_gateway_url }}\ validation_api_apigateway_key_id: ${{ steps.parse_cdk_output.outputs.api_gateway_key_id }} + test_env_name: ${{ steps.get_test_env_name.outputs.test_env_name }} steps: - name: Checkout uses: actions/checkout@v4 @@ -159,6 +160,20 @@ jobs: run: | npm ci + - name: Select credentials + id: select_credentials + shell: bash + env: + TEST_ENVIRONMENT_NAME: ${{ needs.prep-itests.outputs.test_env_name }} + run: | + if [ "${TEST_ENVIRONMENT_NAME}" == 'main' ]; then + echo 'aws_access_key=${{secrets.AWS_ACCESS_KEY_ID_PROD}}' >> ${GITHUB_OUTPUT} + echo 'aws_secret_access_key=${{secrets.AWS_SECRET_ACCESS_KEY_PROD}}' >> ${GITHUB_OUTPUT} + else + echo 'aws_access_key=${{secrets.AWS_ACCESS_KEY_ID_DEV}}' >> ${GITHUB_OUTPUT} + echo 'aws_secret_access_key=${{secrets.AWS_SECRET_ACCESS_KEY_DEV}}' >> ${GITHUB_OUTPUT} + fi + - name: Retrieve API Key for Validation API and run tests shell: bash working-directory: packages/otelbin-validation