SuperAPI AI 工具集

github-issues

编程与开发

查看项目

更新于 10-16 02:32

技能介绍

用途:在 GitHub 仓库中创建、搜索、分类(triage)和管理 issue,覆盖查看、创建、标签、指派、评论、关闭/重开、关联 PR 及批量操作。每个操作先给出 gh 命令,再给出 curl 调用 REST API 的备选方式。

前提:已通过 GitHub 认证(参见 github-auth 技能);需位于带 GitHub remote 的 git 仓库中,或显式指定仓库。

主要能力:

  • 查看与搜索:gh issue list、gh issue view 42,支持按状态、标签、指派人和关键词过滤;curl 对应 GET /repos/{o}/{r}/issues 与 /search/issues。
  • 创建:gh issue create --title --body --label --assignee;curl 对应 POST /repos/{o}/{r}/issues。资料还给出 Bug 报告与功能请求模板。
  • 管理:gh issue edit 增删标签与指派;gh issue comment 评论;gh issue close/reopen 关闭与重开;curl 对应 labels、assignees、comments 及 PATCH issue 端点。
  • 关联 PR:PR 正文含 Closes #42、Fixes #42、Resolves #42 可自动关闭 issue;gh issue develop 42 --checkout 可从 issue 创建分支。
  • 分类流程:列出 needs-triage 的 issue,阅读并归类,打标签与优先级,明确负责人时指派,必要时评论。
  • 批量操作:结合 shell 脚本,如用 gh issue list --json number --jq 配合 xargs 批量关闭,或用 curl 循环处理。

使用方式:先运行资料中的 Setup 片段判断使用 gh 还是 git/curl,并解析 OWNER 与 REPO;随后按需执行对应命令。

限制:需有效 GitHub 认证与仓库访问权限;curl 方式需 GITHUB_TOKEN;GitHub API 的 /issues 端点也会返回 PR,脚本中需过滤 pull_request 字段;批量操作依赖 shell 环境。