我正在尝试列出组织中所有repos的合作者。我的查询如下所示。
query($login: String!, $cursor: String) {
organization(login: $login) {
url
login
repositories(first: 100, after: $cursor) {
pageInfo {
endCursor
hasNextPage
}
nodes {
name
collaborators(affiliation: OUTSIDE, first: 100) {
edges {
permission
}
nodes {
url
login
name
email
company
}
}
}
}
}
}这在GraphQL Explorer中工作得很好。没有权限错误,因为我的用户拥有必要的权限。
但是,如果我尝试直接从GraphQL应用编程接口端点执行此操作,则会得到:
[
{
"type": "FORBIDDEN",
"path": [
"organization",
"repositories",
"nodes",
0,
"collaborators"
],
"locations": [
{
"line": 18,
"column": 21
}
],
"message": "Must have push access to view repository collaborators."
},我已经给了我的个人访问令牌所有可能的范围来调试,但问题仍然存在。
因为我的用户是org admin,并且可以列出GraphQL资源管理器中的所有协作者,所以我希望它能正常工作。
发布于 2021-07-17 09:19:44
我已经为我的个人访问令牌提供了所有可能的调试范围,但问题仍然存在。
然而,如果您没有对这些存储库的推送/写入访问权限,那么无论您为令牌指定了什么作用域,您都会收到该错误消息。
(以illustrated here身份)
另请参阅isaacs/github issue 444以进行确认。
https://stackoverflow.com/questions/68415640
复制相似问题