소스 검색

feat: 添加 GitHub Copilot 连接测试脚本

zhch158_admin 3 달 전
부모
커밋
81375da774
1개의 변경된 파일41개의 추가작업 그리고 0개의 파일을 삭제
  1. 41 0
      zhch/curl_github_ssh_port.sh

+ 41 - 0
zhch/curl_github_ssh_port.sh

@@ -0,0 +1,41 @@
+#!/bin/bash
+# filepath: /Users/zhch158/workspace/repository.git/dots.ocr/zhch/test_copilot_connection.sh
+
+PROXY_PORT=7280
+
+echo "Testing GitHub Copilot connectivity..."
+
+# 测试基本的 GitHub API 访问
+echo "1. Testing GitHub API..."
+if curl -s --proxy http://localhost:$PROXY_PORT --connect-timeout 10 https://api.github.com/user > /dev/null; then
+    echo "✓ GitHub API accessible"
+else
+    echo "✗ GitHub API not accessible"
+fi
+
+# 测试 Copilot 特定的端点
+echo "2. Testing Copilot proxy service..."
+if curl -s --proxy http://localhost:$PROXY_PORT --connect-timeout 10 https://copilot-proxy.githubusercontent.com > /dev/null; then
+    echo "✓ Copilot proxy service accessible"
+else
+    echo "✗ Copilot proxy service not accessible"
+fi
+
+# 测试用户内容服务
+echo "3. Testing GitHub user content..."
+if curl -s --proxy http://localhost:$PROXY_PORT --connect-timeout 10 https://raw.githubusercontent.com > /dev/null; then
+    echo "✓ GitHub user content accessible"
+else
+    echo "✗ GitHub user content not accessible"
+fi
+
+echo "4. Testing with authentication (if token available)..."
+if [ ! -z "$GITHUB_TOKEN" ]; then
+    if curl -s --proxy http://localhost:$PROXY_PORT -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/user > /dev/null; then
+        echo "✓ GitHub authenticated API accessible"
+    else
+        echo "✗ GitHub authenticated API not accessible"
+    fi
+else
+    echo "ℹ GITHUB_TOKEN not set, skipping authenticated test"
+fi