File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # Vercel Ignored Build Step. Exit 1 => BUILD. Exit 0 => SKIP (no Build CPU Minutes).
3+ # Bias: when uncertain, BUILD. Canonical copy lives in @iserlabs/web-kit; vendored per repo.
4+ set -u
5+
6+ # 1) Kill automatic preview builds unless this project opts to keep them.
7+ if [ " ${VERCEL_ENV:- } " = " preview" ] && [ " ${KEEP_PREVIEWS:- } " != " 1" ]; then
8+ echo " skip: automatic preview build" ; exit 0
9+ fi
10+
11+ # 2) Explicit override for intentional no-code rebuilds (env-var change, redeploy).
12+ if [ " ${FORCE_BUILD:- } " = " 1" ] || git log -1 --pretty=%B 2> /dev/null | grep -qi ' \[build\]' ; then
13+ echo " build: forced" ; exit 1
14+ fi
15+
16+ # 3) Diff base. Shallow clones may lack the parent => fail-safe to BUILD.
17+ BASE=" ${VERCEL_GIT_PREVIOUS_SHA:- } "
18+ [ -z " $BASE " ] && BASE=" $( git rev-parse HEAD^ 2> /dev/null || true) "
19+ [ -z " $BASE " ] && { echo " build: no diff base (fail-safe)" ; exit 1; }
20+
21+ CHANGED=" $( git diff --name-only " $BASE " HEAD 2> /dev/null || true) "
22+ [ -z " $CHANGED " ] && { echo " build: empty/failed diff (fail-safe)" ; exit 1; }
23+
24+ # 4) Inert allow-list ONLY. Never list content dirs (src/content/**, app pages, public/**).
25+ DEPLOYABLE=" $( printf ' %s\n' " $CHANGED " \
26+ | grep -vE ' (^|/)(README|CLAUDE|AGENTS)\.md$|^docs/|^\.github/|\.(test|spec)\.[jt]sx?$|^\.editorconfig$|^\.vscode/' \
27+ || true) "
28+ [ -z " $DEPLOYABLE " ] && { echo " skip: only inert paths changed" ; exit 0; }
29+
30+ echo " build: deployable changes present" ; exit 1
Original file line number Diff line number Diff line change 55 "path" : " /api/cron/expire-shares" ,
66 "schedule" : " 0 3 * * *"
77 }
8- ]
8+ ],
9+ "ignoreCommand" : " KEEP_PREVIEWS=1 bash scripts/ci/vercel-ignore.sh"
910}
You can’t perform that action at this time.
0 commit comments