mirror of
https://github.com/bmadcode/BMAD-METHOD.git
synced 2025-12-29 16:14:59 +00:00
feat: add PR validation workflow and contribution checks
This commit is contained in:
37
tools/setup-hooks.sh
Executable file
37
tools/setup-hooks.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Setup script for git hooks
|
||||
echo "Setting up git hooks..."
|
||||
|
||||
# Install husky
|
||||
npm install --save-dev husky
|
||||
|
||||
# Initialize husky
|
||||
npx husky init
|
||||
|
||||
# Create pre-commit hook
|
||||
cat > .husky/pre-commit << 'EOF'
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
# Run validation checks before commit
|
||||
echo "Running pre-commit checks..."
|
||||
|
||||
npm run validate
|
||||
npm run format:check
|
||||
npm run lint
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "❌ Pre-commit checks failed. Please fix the issues before committing."
|
||||
echo " Run 'npm run format' to fix formatting issues"
|
||||
echo " Run 'npm run lint:fix' to fix some lint issues"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Pre-commit checks passed!"
|
||||
EOF
|
||||
|
||||
chmod +x .husky/pre-commit
|
||||
|
||||
echo "✅ Git hooks setup complete!"
|
||||
echo "Now commits will be validated before they're created."
|
||||
Reference in New Issue
Block a user