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]`
This commit is contained in:
Mason Daugherty 2025-08-18 17:33:27 -04:00 committed by GitHub
parent 00259b0061
commit d204f0dd55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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" ] || \