File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 branches : [main]
88
99jobs :
10+ # Stale-green guard. A PR can show a green CI run that was executed BEFORE a
11+ # breaking commit landed on the base branch — merging it would ship a broken
12+ # main. This job FAILS if the PR branch does not contain origin/<base> as an
13+ # ancestor, forcing an "Update branch" before the PR can merge.
14+ up-to-date-with-base :
15+ runs-on : ubuntu-latest
16+ if : github.event_name == 'pull_request'
17+ steps :
18+ - uses : actions/checkout@v5
19+ with :
20+ fetch-depth : 0
21+ - name : Fail if PR branch is behind its base branch
22+ run : |
23+ BASE="${{ github.event.pull_request.base.ref }}"
24+ git fetch origin "${BASE}" --depth=1
25+ if git merge-base --is-ancestor "origin/${BASE}" HEAD; then
26+ echo "PR branch contains origin/${BASE} — up to date."
27+ else
28+ echo "::error::PR branch is behind origin/${BASE}. Update the branch (merge/rebase ${BASE}) and re-run CI so it validates against current base."
29+ exit 1
30+ fi
31+
1032 build-and-test :
1133 runs-on : ubuntu-latest
1234 steps :
1840 cache : ' npm'
1941
2042 - run : npm ci
43+ # `npm run build` runs `tsc && vite build && node scripts/prerender.mjs`.
44+ # The prerender step is part of CI — a local `vite build` alone is NOT a
45+ # valid gate. `npm run gate` (package.json) runs this exact sequence.
2146 - run : npm run build
2247 - run : npm test
2348
You can’t perform that action at this time.
0 commit comments