git - 使用 Github API 在 GitHub 上查询组织内的存储库
问题描述
我需要在 Github 上的特定组织内组装脚本,该脚本将从“test*”开始获取存储库的名称。
任何人都可以提示我 - 以哪种方式挖掘?这可以通过一些 API 查询实现,还是我可以通过 git 命令行来实现?
解决方案
您可以使用搜索查询按位于 repo 名称、描述或 README 中的关键字过滤存储库test
(但没有仅用于 repo 名称的过滤器):
Github API v3 休息
https://api.github.com/search/repositories?q=org%3Agithub%20test&per_page=100
Github API v4 GraphQL
{
search(query: "test org:github", type: REPOSITORY, first: 100) {
repositoryCount
edges {
node {
... on Repository {
nameWithOwner
}
}
}
}
}
推荐阅读
- networking - Chrome 开发工具网络无法检测到 WebSocket?
- office365 - 用于安全性和合规性中的内容搜索的 Rest API - Office 365
- asynchronous - 如何让fluent-ffmpeg在执行下一行代码之前完成渲染?
- javascript - 是否可以在 React js 的类体之外声明一个与类同名的函数?
- c - 在 C 中的 pacman 中放置并更改播放器的位置
- swift - 从另一个类调用函数:只有一些代码被调用
- python - tkinter 的 Python 问题
- javascript - 如何在手机上隐藏下拉菜单的子链接?
- azure - 发布带有 React + 身份验证的 Asp.net core 3.1.3 到 Azure Linux App Service 不起作用
- spring-security - 即使使用 antmatcher 许可,带有 Keycloak 的 Spring Security 也会重定向到登录