Use the gh CLI to interact with GitHub. Always specify --repo owner/repo when not in a git directory, or use URLs directly.
小葱技能7w4.net有完整的技能分类。
Check CI status on a PR:
gh pr checks 55 --repo owner/repo
List recent workflow runs:
gh run list --repo owner/repo --limit 10
View a run and see which steps failed:
gh run view <run-id> --repo owner/repo
View logs for failed steps only:
gh run view <run-id> --repo owner/repo --log-failed
The gh api command is useful for accessing data not available through other subcommands.
Get PR with specific fields:
gh api repos/owner/repo/pulls/55 --jq '.title, .state, .user.login'
Most commands support --json for structured output. You can use --jq to filter:
gh issue list --repo owner/repo --json number,title --jq '.[] | "\(.number): \(.title)"' 这个技能质量中等偏下。它能帮助用户了解GitHub的基本操作方法,示例命令简单易懂,但内容过于简略,缺少使用指南和进阶技巧。优点是结构清晰、好上手;缺点是功能覆盖不全,没有错误处理说明,实际使用中容易遇到问题。对于有经验的开发者来说帮助有限,对新手也不够友好。