feat: Add troubleshooting guide and enhance act scripts

- Created a new troubleshooting guide in README.md for common issues and testing problems.
- Updated package.json to include new act commands for linting, type checking, building, and diagnosing workflows.
- Added a pre-commit hook script to validate workflows before commits.
- Enhanced run-act.sh script with logging, Docker checks, and improved output formatting.
- Improved test-workflows.sh with an interactive menu and performance tracking.
- Introduced setup-act.sh for quick setup and testing of act integration.
This commit is contained in:
2025-12-25 13:16:45 +00:00
committed by GitHub
parent 70088ee9cd
commit b3e17e7dd4
74 changed files with 4319 additions and 497 deletions

47
scripts/pre-commit.hook Normal file
View File

@@ -0,0 +1,47 @@
#!/bin/bash
# Pre-commit git hook for MetaBuilder
# Validates workflows before commits
# Install: cp scripts/pre-commit.hook .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit
set -e
# Colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo -e "${GREEN}Pre-Commit Workflow Validation${NC}"
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo ""
# Check if any workflow files were modified
if ! git diff --cached --name-only | grep -q '^\.github/workflows/'; then
echo " No workflow files changed, skipping validation"
exit 0
fi
# Run diagnostics if workflow files changed
echo -e "${YELLOW}Validating workflow files...${NC}"
if command -v ./scripts/diagnose-workflows.sh &> /dev/null; then
chmod +x scripts/diagnose-workflows.sh
./scripts/diagnose-workflows.sh
if [ $? -ne 0 ]; then
echo ""
echo -e "${YELLOW}⚠️ Workflow issues detected. Review above before committing.${NC}"
echo "To skip this check: git commit --no-verify"
exit 1
fi
else
echo "Diagnostic script not found, skipping workflow validation"
fi
echo ""
echo -e "${GREEN}✓ Pre-commit checks passed!${NC}"
echo ""
exit 0