mirror of
https://github.com/zhouxiaoka/autoclip.git
synced 2026-09-02 22:15:18 +08:00
fix: remove unused eslint-disable directive; inject PostHog key in CI build
- posthog.ts: drop redundant no-console disable (project has no no-console rule; --report-unused-disable-directives failed CI lint) - desktop-build.yml: pass VITE_PUBLIC_POSTHOG_KEY/HOST into the frontend build so released DMGs actually report analytics (was no-op without the key) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
8
.github/workflows/desktop-build.yml
vendored
8
.github/workflows/desktop-build.yml
vendored
@@ -62,6 +62,14 @@ jobs:
|
||||
run: cargo install tauri-cli --locked --version "^2.0"
|
||||
|
||||
- name: Build desktop app (PBS route)
|
||||
env:
|
||||
# PostHog analytics. The phc_ key is a public client key (it ships in
|
||||
# the frontend bundle anyway), but we keep it in repo Secrets so it's
|
||||
# easy to rotate and not hard-coded. Set this secret in
|
||||
# Settings -> Secrets and variables -> Actions. If unset, the build
|
||||
# still succeeds and analytics is a no-op at runtime.
|
||||
VITE_PUBLIC_POSTHOG_KEY: ${{ secrets.VITE_PUBLIC_POSTHOG_KEY }}
|
||||
VITE_PUBLIC_POSTHOG_HOST: ${{ vars.VITE_PUBLIC_POSTHOG_HOST || 'https://us.i.posthog.com' }}
|
||||
run: bash scripts/build_macos_arm.sh
|
||||
|
||||
- name: Upload DMG artifact
|
||||
|
||||
@@ -39,7 +39,6 @@ export function initAnalytics(): void {
|
||||
if (initialized) return
|
||||
if (!POSTHOG_KEY) {
|
||||
if (import.meta.env.DEV) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.info('[analytics] 未配置 VITE_PUBLIC_POSTHOG_KEY,埋点已禁用')
|
||||
}
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user