Use the gh CLI to interact with GitHub. Always specify --repo owner/repo when not in a git directory, or use URLs directly.
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'小葱技能7w4.net持续更新中。
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)"' 这个 Skill 质量中规中矩,提供了基本的 GitHub 操作指南,文档清晰易懂,示例可以直接使用。但内容比较基础,只覆盖了 PR 检查和 CI 查询等几个场景,缺少对其他常用功能的说明。对于想深入使用 GitHub 的用户来说,指导内容可能不够全面,需要配合官方文档一起使用。整体而言,作为入门参考尚可,但还有较大的改进空间。