fix: ai-review gracefully skips when LiteLLM secrets not configured
PR Pipeline — Authorize → Validate → Review → Merge / auth (pull_request) Successful in 2s
PR Pipeline — Authorize → Validate → Review → Merge / validate (pull_request) Successful in 2s
PR Pipeline — Authorize → Validate → Review → Merge / lint (pull_request) Successful in 3s
PR Pipeline — Authorize → Validate → Review → Merge / ai-review (pull_request) Successful in 2s
PR Pipeline — Authorize → Validate → Review → Merge / gate (pull_request) Successful in 1s

This commit is contained in:
root
2026-07-04 23:30:25 +00:00
parent 889f4e4dd1
commit e59f59d776
+7
View File
@@ -97,6 +97,13 @@ PROMPT
) )
echo "=== Sending to LiteLLM for review ===" echo "=== Sending to LiteLLM for review ==="
# Skip if LiteLLM is not configured (secrets not available)
if [ -z "${LITELLM_URL:-}" ] || [ -z "${LITELLM_KEY:-}" ]; then
echo "⚠️ LiteLLM secrets not configured — skipping AI review"
echo " Set LITELLM_URL and LITELLM_KEY as Gitea repository secrets"
exit 0
fi
RESPONSE=$(curl -sf -X POST "$LITELLM_URL/v1/chat/completions" \ RESPONSE=$(curl -sf -X POST "$LITELLM_URL/v1/chat/completions" \
-H "Authorization: Bearer $LITELLM_KEY" \ -H "Authorization: Bearer $LITELLM_KEY" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \