'Get Github repositories owners in an Organization
I'm trying to get a list of Admin inside a repository in an organization,
couldn't find a away to get it working, always returning me Organization name instead of Administrator name of the repository
query Github {
organization(login: "platform-test") {
repositories(first: 100,after:"Y3Vyc29ysd654OAAKz-A==") {
nodes {
nameWithOwner
owner{
login
id
__typename
url
}
}
pageInfo {
endCursor
hasNextPage
}
totalCount
}
}
}
Will return this snap of result :
"data": {
"organization": {
"repositories": {
"nodes": [
{
"nameWithOwner": "Platform-test/afapi-aps-bigfix",
"owner": {
"login": "Platform-test",
"id": "MDEyOk9yZ2FuaXphdGlvbjc2NjA=",
"__typename": "Organization",
"url": "https://github.dxc.com/Platform-test"
}
},
{
"nameWithOwner": "Platform-test/CVA-operation-k8s-pre",
"owner": {
"login": "Platform-test",
"id": "MDEyOk9yZ2FuaXphdGlvbjc2NjA=",
"__typename": "Organization",
"url": "https://github.dxc.com/Platform-test"
}
},....
Couldn't find a way to get the list of administrators of a repository inside an Org
Solution 1:[1]
I user this query to retrieve the Admins
{
organization(login: "Coorp") {
repositories(first: 100, after: null) {
nodes {
id
nameWithOwner
description
url
collaborators(first: 20, after: null) {
edges {
permission
node {
id
name
email
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Eduard |