gpt4 book ai didi

github - 在 graphql 查询中区分私有(private)/内部 github 存储库

转载 作者:行者123 更新时间:2023-12-04 09:28:29 26 4
gpt4 key购买 nike

我正在尝试从我们的组织中获取所有私有(private)存储库。在以下 graphql 查询中,它返回内部和私有(private)存储库。
对于 privacy只能过滤 PRIVATEPUBLIC .
似乎只有一个字段名为 isPrivate , 一点也不像 isInternal据我所知。

query organizationRepositories($owner: String!) {
organization(login:$owner) {
repositories(first: 100, privacy: PRIVATE) {
totalCount
nodes {
owner {
login
}
name
id
url
isPrivate
}
}
}
}
使用上述查询的所有结果显示 isPrivate: true ,我知道其中一些是内部的,有些是私有(private)的。
有没有办法区分私有(private)和内部存储库?通过基于指示私有(private)与内部的某些字段组合循环结果或通过以不同方式查询。

最佳答案

您可以使用搜索查询:

query {
search(query: "org:<my-org> is:internal", type: REPOSITORY, first: 100) {
repositoryCount
nodes {
... on Repository {
name
}
}
}
}
如需更多信息,请参阅 https://docs.github.com/en/github/searching-for-information-on-github/searching-for-repositories#search-by-repository-visibility

关于github - 在 graphql 查询中区分私有(private)/内部 github 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62933888/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com