Files
gh-atournayre-claude-market…/skills/git-pr/scripts/smart_qa.sh
2025-11-29 17:58:54 +08:00

32 lines
733 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Détecte les fichiers PHP modifiés et lance make qa si nécessaire
# Usage: smart_qa.sh
# Exit: 0=ok/ignoré, 1=échec QA
set -euo pipefail
# Détecter fichiers PHP modifiés
PHP_FILES=$(git diff --name-only --cached | grep '\.php$' || true)
if [ -z "$PHP_FILES" ]; then
echo " Aucun fichier PHP modifié - QA ignorée"
exit 0
fi
echo "🔍 Fichiers PHP détectés - Lancement de make qa..."
echo "$PHP_FILES" | sed 's/^/ - /'
# Lancer QA avec timeout
if timeout 600 make qa; then
echo "✅ QA passée avec succès"
exit 0
else
EXIT_CODE=$?
if [ $EXIT_CODE -eq 124 ]; then
echo "❌ QA timeout (>600s)" >&2
else
echo "❌ QA échouée" >&2
fi
exit 1
fi