fix: split security hardening and setup mcporter config checks

This commit is contained in:
Your Name 2026-02-27 12:16:00 +08:00
parent a5682716ec
commit 4b2e6f2ffb
7 changed files with 348 additions and 114 deletions

View file

@ -20,10 +20,12 @@ class GitHubChannel(Channel):
if not shutil.which("gh"):
return "warn", "gh CLI 未安装。安装https://cli.github.com"
try:
subprocess.run(
r = subprocess.run(
["gh", "auth", "status"],
capture_output=True, text=True, timeout=5
)
return "ok", "完整可用读取、搜索、Fork、Issue、PR 等)"
if r.returncode == 0:
return "ok", "完整可用读取、搜索、Fork、Issue、PR 等)"
return "warn", "gh CLI 已安装但未认证。运行 gh auth login 可解锁完整功能"
except Exception:
return "ok", "gh CLI 已装但未认证。运行 gh auth login 可解锁完整功能"
return "warn", "gh CLI 状态检查失败,运行 gh auth status 查看详情"