Skip to content

Commit

Permalink
Adding a graphql script for user permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
gm3dmo committed Jun 30, 2024
1 parent ec3cbb6 commit 92f32cd
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions gh-graphql-repos-another-users-permissions-example.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
. ./.gh-api-examples.conf

# https://cli.github.com/manual/gh_api
# Demonstrates pagination for gh api

export GH_TOKEN=${GITHUB_TOKEN}

gh api graphql --paginate -F owner="${org}" -F is_archived=false -f query='
query ($owner: String!, $after: String, $is_archived: Boolean!) {
organization(login: $owner) {
repositories(
isArchived: $is_archived
first: 100
orderBy: {field: PUSHED_AT, direction: DESC}
after: $after
) {
nodes {
name
description
url
collaborators(first: 5, affiliation: ALL) {
edges {
permission
node {
id
login
name
email
}
}
pageInfo {
hasNextPage
endCursor
}
}
pushedAt
}
pageInfo {
endCursor
hasNextPage
}
}
}
}
'

0 comments on commit 92f32cd

Please sign in to comment.