Skip to content

Commit

Permalink
chore(build): use dotenv to read .env for sentry auth token
Browse files Browse the repository at this point in the history
  • Loading branch information
KatoakDR committed Oct 9, 2023
1 parent f8eabae commit 3cb5ca2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ jobs:
run: |
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> .env
echo "MAIN_VITE_SENTRY_DSN=${{ secrets.MAIN_VITE_SENTRY_DSN }}" >> .env
echo "MAIN_VITE_SENTRY_CRASH_REPORT_DSN=${{ secrets.MAIN_VITE_SENTRY_CRASH_REPORT_DSN }}" >> .env
echo "MAIN_VITE_SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> .env
echo "MAIN_VITE_SENTRY_CRASH_REPORT_DSN=${{ secrets.SENTRY_CRASH_REPORT_DSN }}" >> .env
echo "RENDERER_VITE_SENTRY_DSN=${{ secrets.RENDERER_VITE_SENTRY_DSN }}" >> .env
echo "RENDERER_VITE_SENTRY_CRASH_REPORT_DSN=${{ secrets.RENDERER_VITE_SENTRY_CRASH_REPORT_DSN }}" >> .env
echo "RENDERER_VITE_SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> .env
echo "RENDERER_VITE_SENTRY_CRASH_REPORT_DSN=${{ secrets.SENTRY_CRASH_REPORT_DSN }}" >> .env
- name: Install dependencies
run: yarn install
Expand Down
2 changes: 2 additions & 0 deletions electron.vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dotenv/config';
import { execSync } from 'child_process';
import { sentryVitePlugin } from '@sentry/vite-plugin';
import react from '@vitejs/plugin-react';
Expand All @@ -13,6 +14,7 @@ const sentryPlugin = sentryVitePlugin({
org: 'dragonrealms-phoenix',
project: 'phoenix',
telemetry: false,
authToken: process.env.SENTRY_AUTH_TOKEN,
disable: process.env.VITE_PLUGIN_SENTRY_ENABLE !== 'true',
}) as PluginOption;

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"@typescript-eslint/parser": "^6.7.3",
"@vitejs/plugin-react": "^4.1.0",
"cross-env": "^7.0.3",
"dotenv": "^16.3.1",
"electron": "^26.2.4",
"electron-builder": "^24.6.4",
"electron-vite": "^1.0.28",
Expand Down

0 comments on commit 3cb5ca2

Please sign in to comment.