File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -281,6 +281,10 @@ Gets a list of members (via GraphQL) and their role in an organization
281
281
282
282
Gets the repository count in an organization
283
283
284
+ ## get-organizations-projects-count.sh
285
+
286
+ Gets the count of projects in all organizations in a given enterprise
287
+
284
288
## get-organization-team-members.sh
285
289
286
290
Gets the members of a team
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ if [ $# -ne 1 ]; then
4
+ echo " usage: $0 <enterprise slug>"
5
+ exit 1
6
+ fi
7
+
8
+ enterprise=$1
9
+
10
+ gh api graphql -f enterprise=" $enterprise " --paginate -f query=' query($enterprise:String!, $endCursor: String) {
11
+ enterprise(slug:$enterprise) {
12
+ organizations(first:100, after: $endCursor) {
13
+ pageInfo { hasNextPage endCursor }
14
+ nodes {
15
+ name
16
+ projectsV2(first:1) { totalCount }
17
+ }
18
+ }
19
+ }
20
+ }' --jq ' .data.enterprise.organizations.nodes[] | [.name, .projectsV2.totalCount] | @tsv'
You can’t perform that action at this time.
0 commit comments