github
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGitHub Skill
GitHub 技能
Use the CLI to interact with GitHub. Always specify when not in a git directory, or use URLs directly.
gh--repo owner/repo使用 CLI与GitHub进行交互。当不在git目录中时,请务必指定,或直接使用URL。
gh--repo owner/repoPull Requests
拉取请求(PR)
Check CI status on a PR:
bash
gh pr checks 55 --repo owner/repoList recent workflow runs:
bash
gh run list --repo owner/repo --limit 10View a run and see which steps failed:
bash
gh run view <run-id> --repo owner/repoView logs for failed steps only:
bash
gh run view <run-id> --repo owner/repo --log-failed查看PR的CI状态:
bash
gh pr checks 55 --repo owner/repo列出最近的工作流运行记录:
bash
gh run list --repo owner/repo --limit 10查看某次运行记录并查看哪些步骤失败:
bash
gh run view <run-id> --repo owner/repo仅查看失败步骤的日志:
bash
gh run view <run-id> --repo owner/repo --log-failedAPI for Advanced Queries
用于高级查询的API
The command is useful for accessing data not available through other subcommands.
gh apiGet PR with specific fields:
bash
gh api repos/owner/repo/pulls/55 --jq '.title, .state, .user.login'gh api获取包含特定字段的PR:
bash
gh api repos/owner/repo/pulls/55 --jq '.title, .state, .user.login'JSON Output
JSON 输出
Most commands support for structured output. You can use to filter:
--json--jqbash
gh issue list --repo owner/repo --json number,title --jq '.[] | "\(.number): \(.title)"'大多数命令支持使用生成结构化输出。你可以使用进行过滤:
--json--jqbash
gh issue list --repo owner/repo --json number,title --jq '.[] | "\(.number): \(.title)"'