Skip to content

Commit 92f32cd

Browse files
committed
Adding a graphql script for user permissions
1 parent ec3cbb6 commit 92f32cd

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
. ./.gh-api-examples.conf
2+
3+
# https://cli.github.com/manual/gh_api
4+
# Demonstrates pagination for gh api
5+
6+
export GH_TOKEN=${GITHUB_TOKEN}
7+
8+
gh api graphql --paginate -F owner="${org}" -F is_archived=false -f query='
9+
query ($owner: String!, $after: String, $is_archived: Boolean!) {
10+
organization(login: $owner) {
11+
repositories(
12+
isArchived: $is_archived
13+
first: 100
14+
orderBy: {field: PUSHED_AT, direction: DESC}
15+
after: $after
16+
) {
17+
nodes {
18+
name
19+
description
20+
url
21+
collaborators(first: 5, affiliation: ALL) {
22+
edges {
23+
permission
24+
node {
25+
id
26+
login
27+
name
28+
email
29+
}
30+
}
31+
pageInfo {
32+
hasNextPage
33+
endCursor
34+
}
35+
}
36+
pushedAt
37+
}
38+
pageInfo {
39+
endCursor
40+
hasNextPage
41+
}
42+
}
43+
}
44+
}
45+
'
46+

0 commit comments

Comments
 (0)