From d204f0dd55e99134e220fa1993bc75cbfc429115 Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Mon, 18 Aug 2025 17:33:27 -0400 Subject: [PATCH] feat(infra): add skip-preview tag check in Vercel deployment script (#32600) Having vercel attempt to deploy on each commit (even if unrelated to docs) was getting annoying. Options: - `[skip-preview]` - `[no-preview]` - `[skip-deploy]` Full example: `fix(core): resolve memory leak [no-preview]` --- docs/ignore-step.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/ignore-step.sh b/docs/ignore-step.sh index 2532c4c48b1..5e075196bf5 100755 --- a/docs/ignore-step.sh +++ b/docs/ignore-step.sh @@ -5,6 +5,14 @@ echo "VERCEL_GIT_COMMIT_REF: $VERCEL_GIT_COMMIT_REF" echo "VERCEL_GIT_REPO_OWNER: $VERCEL_GIT_REPO_OWNER" echo "VERCEL_GIT_REPO_SLUG: $VERCEL_GIT_REPO_SLUG" +echo "Checking for skip-preview tags..." +COMMIT_MESSAGE=$(git log -1 --pretty=%B) +echo "Commit message: $COMMIT_MESSAGE" +if [[ "$COMMIT_MESSAGE" == *"[skip-preview]"* ]] || [[ "$COMMIT_MESSAGE" == *"[no-preview]"* ]] || [[ "$COMMIT_MESSAGE" == *"[skip-deploy]"* ]]; then + echo "🛑 Skip-preview tag found in commit message - skipping preview deployment" + exit 0 +fi + if { \ [ "$VERCEL_ENV" == "production" ] || \ @@ -13,10 +21,10 @@ if { \ [ "$VERCEL_GIT_COMMIT_REF" == "v0.2" ] || \ [ "$VERCEL_GIT_COMMIT_REF" == "v0.3rc" ]; \ } && [ "$VERCEL_GIT_REPO_OWNER" == "langchain-ai" ] -then +then echo "✅ Production build - proceeding with build" exit 1 -fi +fi echo "Checking for changes in docs/"