出海助手-GitHub协作
> 本技能改造自开源技能 github(来源:openclaw/openclaw,openclaw 开源技能生态)。已完整保留原始运行文件(scripts/references/assets 与 LICENSE),并新增中文出海使用说明。原始英文说明见文末「English (Original)」与同目录 SKILL.original.md。
功能说明 / Functional Overview
用官方 gh CLI 操作 GitHub(PR、Issue、CI/运行记录、REST API),本地提交 / 分支 / 推送用 git,深度评审用代码阅读工具。
适用场景 / Use Cases
- 查看 / 创建 / 合并 PR,处理 Issue,查看 CI 运行状态
- 直接调用 GitHub REST API 取结构化数据
使用方法 / How to Use
- PR:
gh pr list/view/checks/diff/create/merge --repo owner/repo - Issue:
gh issue list/view/create/comment/close --repo owner/repo - CI:
gh run list/view --log-failed/rerun --repo owner/repo - API:
gh api repos/owner/repo/pulls/55 --jq '.title';含反引号 / shell 片段的用--body-file - URL 可直接用:
gh pr view https://github.com/owner/repo/pull/55
示例 / Examples
gh pr create --repo owner/repo --title "feat: 标题" --body-file /tmp/pr.mdgh run view <run-id> --repo owner/repo --log-failed
限制说明 / Limitations
- 网关 HOME 可能与操作员 HOME 不同;若
gh鉴权在别处,需在网关服务环境设置GH_CONFIG_DIR并重启。 - 含反引号、环境变量名或用户文本的内容务必用
--body-file,避免被 shell 吞掉。
English (Original) / 英文原文(完整保留)
> The section below is the original skill definition, preserved verbatim for traceability and full functionality.
GitHub
Use gh for GitHub. Use git for local commits/branches/push/pull. Use code-reading tools for deep reviews.
Auth
gh auth status
gh auth login
Gateway HOME can differ from operator HOME. If gh auth exists elsewhere, set GH_CONFIG_DIR in the gateway service env and restart.
PRs
gh pr list --repo owner/repo --json number,title,state,author,url
gh pr view 55 --repo owner/repo --json title,body,author,files,commits,reviews,reviewDecision
gh pr checks 55 --repo owner/repo
gh pr diff 55 --repo owner/repo
gh pr create --repo owner/repo --title "feat: title" --body-file /tmp/pr.md
gh pr merge 55 --repo owner/repo --squash
URLs work directly: gh pr view https://github.com/owner/repo/pull/55.
Issues
gh issue list --repo owner/repo --state open --json number,title,labels,url
gh issue view 42 --repo owner/repo --json title,body,comments,labels,state
gh issue create --repo owner/repo --title "Bug: ..." --body-file /tmp/issue.md
gh issue comment 42 --repo owner/repo --body-file /tmp/comment.md
gh issue close 42 --repo owner/repo --comment "Fixed in ..."
CI/runs
gh run list --repo owner/repo --limit 10
gh run view <run-id> --repo owner/repo --json status,conclusion,headSha,url
gh run view <run-id> --repo owner/repo --log-failed
gh run rerun <run-id> --repo owner/repo --failed
API
gh api repos/owner/repo/pulls/55 --jq '.title, .state, .user.login'
gh api repos/owner/repo/labels --jq '.[].name'
gh api --cache 1h repos/owner/repo --jq '{stars: .stargazers_count, forks: .forks_count}'
Use --json + --jq for structured output. Use --body-file for comments/bodies containing backticks, shell snippets, env names, or user text.