自动化中等风险

GitHub 技能

通过 gh CLI 与 GitHub 交互,管理 Issue、PR、CI 运行及高级 API 查询。

by @skillhubv1.0.07 浏览3 下载
#API#ci-cd#gh-cli#github#issue#pull-request#命令行
推荐方式

直接交给 AI

无需安装文件。复制一句话,让 AI 在线读取这个 Skill。

下载 Skill ZIP ↓ 查看 SKILL.md 原文 ↗
01

它能帮你做什么

先看懂,再决定要不要交给 AI。

该技能封装了 GitHub 官方命令行工具 gh 的常用操作,涵盖 Issue 列表与查看、Pull Request 检查与状态查询、CI/Workflow 运行查看及日志检索,以及通过 gh api 进行高级数据查询。支持 --repo 参数指定仓库或直接使用 URL,并提供 --json 与 --jq 选项以结构化输出与过滤结果,便于脚本化处理与集成。

✓查看 PR 的 CI 检查状态
✓列出最近的工作流运行
✓查看失败步骤的日志
✓通过 gh api 查询仓库高级数据
✓以 JSON 格式过滤 issue 或 PR 信息
02

怎么交给 AI

在线读取优先,本地安装作为备选。

◎
在线读取推荐 · 不需要安装

适合能访问网页的 ChatGPT、Agent 或其他 AI。

AI Prompt请访问 https://skills.dhmip.cn/skills/skillhub/github/SKILL.md,读取并按照该 Skill 完成任务;如当前环境支持本地安装,也可以下载该 Skill。
↓
下载安装到 Agent适合支持 Skills 的客户端

未登录时可使用公共安装文档;登录后可以按不同 AI 分开管理。

Install Prompt请根据 https://skills.dhmip.cn/install/skillhub.md,安装 @skillhub/github。
登录后管理多个 AI →
03

兼容性与要求

安装或使用前,先确认环境是否匹配。

适用客户端

命令行终端支持执行 Shell 的 Agent 客户端

使用要求

  • 系统已安装并认证 gh CLI
  • 具备目标仓库的访问权限
  • 使用 --repo 参数或 URL 明确指定仓库
⌘技术详情查看完整 SKILL.md 与原始内容
⌄
SKILL.mdRaw ↗

name: github
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."


GitHub Skill

Use the gh CLI to interact with GitHub. Always specify --repo owner/repo when not in a git directory, or use URLs directly.

Pull Requests

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

API for Advanced Queries

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'

JSON Output

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)"'