# Run linting and tests
npm run lint
npm run test:silent

# Rebuild GitHub Action bundle and stage it
# This prevents self-mutation failures in CI when dist/action/ is out of sync
echo "📦 Rebuilding GitHub Action bundle..."
npm run build:action
git add -f dist/action/

# Validate GitHub Actions workflows if act is available
if command -v act >/dev/null 2>&1; then
  echo "🔍 Validating GitHub Actions workflows..."
  npm run validate:workflows
else
  echo "⚠️  act not found - skipping workflow validation"
  echo "   Install with: brew install act"
fi
