diff --git a/.github/workflows/elite-ai-agent.yml b/.github/workflows/elite-ai-agent.yml index 78ee4fa..2b26873 100644 --- a/.github/workflows/elite-ai-agent.yml +++ b/.github/workflows/elite-ai-agent.yml @@ -90,8 +90,8 @@ jobs: CONFIDENCE="${{ inputs.confidence_threshold || env.ML_CONFIDENCE }}" BROKEN_DEPS=$(npm audit --json 2>/dev/null | jq '.metadata.vulnerabilities.total' 2>/dev/null || echo "0") - TEST_FAILURES=$(npm test 2>&1 | grep -c "failing" || echo "0") - TYPING_ISSUES=$(npx tsc --noEmit 2>&1 | grep -c "error TS" || echo "0") + TEST_FAILURES=$(npm test 2>&1 | grep -c "failing" || true) + TYPING_ISSUES=$(npx tsc --noEmit 2>&1 | grep -c "error TS" || true) RISK_SCORE=$(echo "scale=4; ($BROKEN_DEPS * 0.4 + $TEST_FAILURES * 0.3 + $TYPING_ISSUES * 0.3) / 100" | bc) if [ -z "$RISK_SCORE" ] || [ "$RISK_SCORE" = "0" ]; then @@ -255,7 +255,7 @@ jobs: full|*) echo "🏥 Full elite repair mode" npm audit fix --force || true - npm run build || (echo "⚠️ Build failed - attempting repair" && npm install --force && npm run build) + npm run build --if-present || (echo "⚠️ Build failed - attempting repair" && npm install --force && npm run build --if-present) npm test || (echo "⚠️ Tests failed - self-healing applied") ;; esac