fix: split security hardening and setup mcporter config checks
This commit is contained in:
parent
a5682716ec
commit
4b2e6f2ffb
7 changed files with 348 additions and 114 deletions
|
|
@ -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 查看详情"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue