From 0752b91cd413e2ea92e32f9b57e103f0f318f89c Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Wed, 18 Dec 2024 07:43:14 +0300 Subject: [PATCH] Check if auth token works as an env variable without file --- .github/workflows/ci_cd.yml | 2 +- frontend/Dockerfile | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 316442988bc..0c9685572c1 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -182,7 +182,7 @@ jobs: uses: docker/build-push-action@v6 with: secrets: | - "sentry_auth_token=${{ matrix.image == 'frontend' && secrets.SENTRY_AUTH_TOKEN }}" + "sentry_auth_token=${{ secrets.SENTRY_AUTH_TOKEN }}" context: ${{ matrix.context }} target: ${{ matrix.target }} push: false diff --git a/frontend/Dockerfile b/frontend/Dockerfile index a9e1189a50a..139cf109167 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -50,14 +50,15 @@ ENV SEMANTIC_VERSION=${SEMANTIC_VERSION} ENV ADD_SENTRY_RELEASE=${ADD_SENTRY_RELEASE} RUN --mount=type=secret,id=sentry_auth_token,mode=0444 \ - sh -c 'if [ "$ADD_SENTRY_RELEASE" = "true" ]; then \ - SENTRY_AUTH_TOKEN="$(cat /run/secrets/sentry_auth_token)" && \ - echo "SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN" >> .env.sentry-build-plugin; \ - fi' && printenv + sh -c 'SENTRY_AUTH_TOKEN="$(cat /run/secrets/sentry_auth_token)"; \ + echo "SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN"; \ + export SENTRY_AUTH_TOKEN; \ + ' && printenv RUN echo add sentry release: "$ADD_SENTRY_RELEASE" && echo semantic version: "$SEMANTIC_VERSION" && echo sentry auth token: "$SENTRY_AUTH_TOKEN" RUN pnpm build + ############ # Nuxt app # ############