# Consumer-side TVU upstream-gate check (GitHub Actions template) # # ⚠️ THIS IS A TEMPLATE — copy to your consumer product repo's # `.github/workflows/upstream-gate.yml`. (Gitea consumers: 用等价 .gitea/workflows/ 语法。) # # What this does: # - On every PR + push, runs the TVU upstream understanding-analysis gate validator. # - chokepoint-bound: only checks when a `docs/specs/upstream-gate..md` exists # in the diff/repo; otherwise no-op PASS (not every PR is a product-design task). # - Deterministic layer only (schema / sources_read anchors / competitive URLs / # data_feasibility vs product-context). Human layer (understanding/persona/MVP) = # owner PR review. # # Prerequisites in the consumer repo: # 1. `@nancyzeng0210/tvu-design-system` is a dependency. # 2. Product-design artifacts live at `docs/specs/upstream-gate..md`. # 3. (Optional, stronger gate) `docs/product-context.md` with `available_data_fields`. name: Upstream Gate on: pull_request: branches: [main, master] push: branches: [main, master] jobs: upstream-gate: runs-on: ubuntu-latest timeout-minutes: 5 steps: - name: Checkout uses: actions/checkout@v4 - name: Install pnpm uses: pnpm/action-setup@v3 with: version: 10 - name: Setup Node uses: actions/setup-node@v4 with: node-version: '20' cache: 'pnpm' - name: Install dependencies run: pnpm install --frozen-lockfile - name: Run upstream-gate validator # 从 node_modules 里跑随包发的 validator,仓库根为 repo-root。 run: node node_modules/@nancyzeng0210/tvu-design-system/scripts/validate-upstream-gate.mjs --repo-root=.