Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix(review): qodo/coderabbit suggestions

justin089d2a201ffd
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index 70ad21bca..309feda7f 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -89,8 +89,9 @@ jobs:
# secret-files mounts the file CONTENTS as the secret value in the
# build. The 'secrets:' input would pass the file path string as
# the value, which is not what BuildKit expects.
- secret-files: |
- SENTRY_AUTH_TOKEN=/tmp/sentry-build-secrets/SENTRY_AUTH_TOKEN
+ # The secret file is only prepared for the web build, so the input
+ # is empty for other matrix entries.
+ secret-files: ${{ matrix.dockerfile == './apps/web/Dockerfile' && 'SENTRY_AUTH_TOKEN=/tmp/sentry-build-secrets/SENTRY_AUTH_TOKEN' || '' }}
trigger-helm-publish:
needs: build-and-push-image
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index 7e0be3163..52a21b36e 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -144,5 +144,6 @@ jobs:
build-args: |
SENTRY_ORG=${{ vars.SENTRY_ORG }}
SENTRY_PROJECT=${{ vars.SENTRY_PROJECT }}
- secrets: |
- SENTRY_AUTH_TOKEN=/tmp/sentry-build-secrets/SENTRY_AUTH_TOKEN
+ # The secret file is only prepared for the web build, so the input
+ # is empty for other matrix entries.
+ secrets: ${{ matrix.dockerfile == './apps/web/Dockerfile' && 'SENTRY_AUTH_TOKEN=/tmp/sentry-build-secrets/SENTRY_AUTH_TOKEN' || '' }}
diff --git a/apps/web/Dockerfile b/apps/web/Dockerfile
index 88834e575..3e484495b 100644
--- a/apps/web/Dockerfile
+++ b/apps/web/Dockerfile
@@ -40,8 +40,11 @@ RUN pnpm run build
# Build the application
WORKDIR /app/apps/web
-RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN \
- SENTRY_AUTH_TOKEN=$(cat /run/secrets/SENTRY_AUTH_TOKEN) \
+# SENTRY_AUTH_TOKEN is optional: only mounted during container builds that
+# need it (e.g., the publish workflows). Local or CI builds without the
+# secret still succeed; the build just runs without it.
+RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN,required=false \
+ if [ -f /run/secrets/SENTRY_AUTH_TOKEN ]; then export SENTRY_AUTH_TOKEN="$(cat /run/secrets/SENTRY_AUTH_TOKEN)"; fi; \
pnpm run build
# Production stage with specific version