跳到正文
Skillpedia
部署与云(DevOps)48k · #4751

github

它能做什么

这个工具可以帮你与 GitHub 交互。GitHub 是开发者存放和分享代码的网站。你可以查看项目运行状态、议题以及代码审查情况。

适用场景

  • ✓当你想确认某个 GitHub 项目是否运行正常时。
  • ✓当你想查看项目中错误的详细信息时。
  • ✓当你想列出或查看代码审查(拉取请求)的状态时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/github/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/github/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“查看 'my-user/my-project' 仓库中第 55 号拉取请求的状态。”

每周 5 个新技能,1 分钟读完。

工作原理

它使用一个名为 `gh` 的程序直接与 GitHub 通信。你告诉它你想要什么,比如查看某个审查的状态,`gh` 就会为你获取相关信息。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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.

When to Use

  • When the user asks about GitHub issues, pull requests, workflow runs, or CI failures.
  • When you need gh issue, gh pr, gh run, or gh api from the command line.

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

Debugging a CI Failure

Follow this sequence to investigate a failing CI run:

  1. Check PR status — identify which checks are failing:
    gh pr checks 55 --repo owner/repo
    
  2. List recent runs — find the relevant run ID:
    gh run list --repo owner/repo --limit 10
    
  3. View the failed run — see which jobs and steps failed:
    gh run view <run-id> --repo owner/repo
    
  4. Fetch failure logs — get the detailed output for failed steps:
    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)"'

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
常见问题

什么是“拉取请求”?

它是一种请求,用于将代码变更添加到项目中。它允许其他人在变更被接受之前进行审查。

什么是“Actions 运行记录”或“工作流运行记录”?

它们是在 GitHub 上自动运行的任务,比如代码测试,用来确保一切运行正常。

我需要会编程才能使用吗?

不需要。你只需要知道项目名称以及想查看的内容,技术部分由工具来处理。

详情

作者的原始描述

Use the `gh` CLI for issues, pull requests, Actions runs, and GitHub API queries.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#4751
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能