Shell
#!/bin/bash
# Deployment Check: Verifies deployment readiness before PR creation
# Only run if we detect PR-related keywords in environment
if [ -n "$PR_CREATION_TRIGGER" ]; then
echo "π Checking deployment readiness..."
# Check for environment variables
if [ -f ".env.example" ] && [ ! -f ".env" ]; then
echo "β οΈ Warning: .env.example exists but no .env file found"
echo "π‘ You may need to configure environment variables"
fi
# Check for Vercel project
if [ -f "vercel.json" ] || [ -d ".vercel" ]; then
echo "π Vercel project detected"
if ! command -v vercel &> /dev/null; then
echo "π‘ Tip: Install Vercel CLI for deployment: npm i -g vercel"
else
echo "β
Vercel CLI ready for deployment"
fi
fi
# Check for package.json build script
if [ -f "package.json" ]; then
if grep -q '"build"' package.json; then
echo "π¦ Running production build check..."
if npm run build > /dev/null 2>&1; then
echo "β
Production build successful"
else
echo "β Production build failed - Claude will fix this"
exit 1
fi
fi
fi
fi
exit 0