通过 API GitHub 回购的只读 属性
Read-only property for GitHub repos via the API
我正在使用他们的 API 开发一个 GitHub 应用程序,并试图确定我正在查询的存储库是否处于只读模式(例如,这个是: https://github.com/carhartl/jquery-cookie).
我搜索了他们的文档和回复,但似乎无法确定回购是否处于只读模式。
任何人对此有任何经验,或者知道我可以在响应正文中使用的东西 determine/infer 回购处于只读模式?
对于存档的回购(只读),original changelog(一年前,2017 年 11 月)没有提到任何相关的 API。
只提到了一个search feature。
https://github.com/search?utf8=%E2%9C%93&q=archived%3Atrue+GNOME&type=
这将匹配已存档并包含单词 "GNOME."
的存储库
也许您可以尝试使用 archived:true
限定符搜索该存储库。
如果搜索 returns 你的回购协议,它是存档的。
一种更简单的方法,当查询 GitHub repository
GET /repos/:owner/:repo
答案将包含一个“archived
”字段
"archived": false,
# or
"archived": true,
我正在使用他们的 API 开发一个 GitHub 应用程序,并试图确定我正在查询的存储库是否处于只读模式(例如,这个是: https://github.com/carhartl/jquery-cookie).
我搜索了他们的文档和回复,但似乎无法确定回购是否处于只读模式。
任何人对此有任何经验,或者知道我可以在响应正文中使用的东西 determine/infer 回购处于只读模式?
对于存档的回购(只读),original changelog(一年前,2017 年 11 月)没有提到任何相关的 API。
只提到了一个search feature。
https://github.com/search?utf8=%E2%9C%93&q=archived%3Atrue+GNOME&type=
这将匹配已存档并包含单词 "GNOME."
的存储库也许您可以尝试使用 archived:true
限定符搜索该存储库。
如果搜索 returns 你的回购协议,它是存档的。
一种更简单的方法,当查询 GitHub repository
GET /repos/:owner/:repo
答案将包含一个“archived
”字段
"archived": false,
# or
"archived": true,