Files
bsk/.github/workflows/ci.yml
T
tiennm99 eeda68c34a chore(ci): add NEXT_PUBLIC_*=sb_secret_* leak guard
Defense-in-depth check that fails the build (and the local pre-push
workflow) if a server secret value is assigned to a NEXT_PUBLIC_*
variable — those get bundled into the browser by Next.js.

- scripts/check-no-secret-leak.mjs: git grep for the assignment shape,
  excluding lockfiles and the script itself
- package.json: pnpm check:no-secret-leak
- .github/workflows/ci.yml: run the guard right after install, before
  format/lint/typecheck/build
- docs/threat-model.md: close the last Unresolved item
2026-05-25 16:19:43 +07:00

54 lines
1.2 KiB
YAML

name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
verify:
name: Lint / Typecheck / Build
runs-on: ubuntu-latest
env:
# Dummy values so build can resolve env schema.
# Real secrets live in the Vercel project, never in CI.
NEXT_PUBLIC_APP_ENV: preview
NEXT_PUBLIC_SUPABASE_URL: https://example.supabase.co
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY: sb_publishable_ci_placeholder
SUPABASE_SECRET_KEY: sb_secret_ci_placeholder
UPSTASH_REDIS_REST_URL: https://example.upstash.io
UPSTASH_REDIS_REST_TOKEN: ci_placeholder
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 11
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Secret-leak guard (sb_secret_* in NEXT_PUBLIC_*)
run: pnpm check:no-secret-leak
- name: Format check
run: pnpm format:check
- name: Lint
run: pnpm lint
- name: Typecheck
run: pnpm typecheck
- name: Build
run: pnpm build