Created
March 14, 2025 18:22
-
-
Save jonjozwiak/55feedde72ff21610a8806af24bf90c2 to your computer and use it in GitHub Desktop.
API call to get teams permissions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gh api graphql --paginate -f owner='your-organization-here' -f repo='your-repo-here' -f affiliation='ALL' -f query=' | |
| query ($owner: String!, $repo: String!, $affiliation: CollaboratorAffiliation!, $endCursor: String) { | |
| repository(owner:$owner, name:$repo) { | |
| name | |
| owner { | |
| login | |
| } | |
| collaborators(first: 100, affiliation: $affiliation, after: $endCursor) { | |
| pageInfo { | |
| endCursor | |
| hasNextPage | |
| } | |
| edges { | |
| node { | |
| login | |
| } | |
| permission | |
| permissionSources { | |
| permission | |
| source { | |
| ... on Team { | |
| type: __typename | |
| name: slug | |
| } | |
| ... on Repository { | |
| type: __typename | |
| name: name | |
| } | |
| ... on Organization { | |
| type: __typename | |
| name: login | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment