File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed
Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 3838 - name : Install dependencies
3939 run : bun install --frozen-lockfile
4040
41+ - name : Validate feature flags
42+ run : |
43+ FILE="apps/sim/lib/core/config/feature-flags.ts"
44+ echo "Checking for hardcoded boolean feature flags in $FILE..."
45+
46+ # Find any "export const isXxx = true" or "export const isXxx = false" patterns
47+ # This catches accidental local testing values being committed
48+ if grep -E "export const is[A-Za-z]+\s*=\s*(true|false)\s*;?\s*$" "$FILE"; then
49+ echo ""
50+ echo "❌ ERROR: Feature flags must not be hardcoded to boolean literals!"
51+ echo "Feature flags should derive their values from environment variables."
52+ echo ""
53+ echo "Example of what NOT to do:"
54+ echo " export const isHosted = true"
55+ echo ""
56+ echo "Example of correct implementation:"
57+ echo " export const isHosted = getEnv('NEXT_PUBLIC_APP_URL') === 'https://www.sim.ai'"
58+ exit 1
59+ fi
60+
61+ echo "✅ All feature flags are properly configured"
62+
4163 - name : Lint code
4264 run : bun run lint:check
4365
Original file line number Diff line number Diff line change 11/**
22 * Environment utility functions for consistent environment detection across the application
33 */
4- import { env , getEnv , isFalsy , isTruthy } from './env'
4+ import { env , isFalsy , isTruthy } from './env'
55
66/**
77 * Is the application running in production mode
@@ -21,9 +21,7 @@ export const isTest = env.NODE_ENV === 'test'
2121/**
2222 * Is this the hosted version of the application
2323 */
24- export const isHosted =
25- getEnv ( 'NEXT_PUBLIC_APP_URL' ) === 'https://www.sim.ai' ||
26- getEnv ( 'NEXT_PUBLIC_APP_URL' ) === 'https://www.staging.sim.ai'
24+ export const isHosted = true
2725
2826/**
2927 * Is billing enforcement enabled
You can’t perform that action at this time.
0 commit comments