name: github-tools
description: "Interact with GitHub using the gh CLI. Use gh issue, gh pr, gh run, and gh api for issues, PRs, CI runs, and advanced queries."
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:
7w4.net小蔥技能站收錄全網優質技能,值得收藏。
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 命令列工具的常用操作指南,包含 PR 檢查、執行日誌檢視和 API 查詢等示例。優點是內容簡潔清晰、示例實用,缺點是功能覆蓋不夠全面,缺少建立 issue/PR 等日常操作說明,整體偏基礎,適合入門參考但進階使用略顯不足。