File tree Expand file tree Collapse file tree 2 files changed +52
-1
lines changed Expand file tree Collapse file tree 2 files changed +52
-1
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,9 @@ Gets the commits of since a certain date - date should be in [ISO 8601](https://
151
151
152
152
## get-dependencies-in-repository.sh
153
153
154
- Gets dependencies used in the repository, including the ecosystem and version number. Example output:
154
+ Gets dependencies used in the repository, including the ecosystem and version number.
155
+
156
+ Example output:
155
157
156
158
``` csv
157
159
@@ -219,6 +221,20 @@ Gets the current IP allow list for an organization.
219
221
220
222
See the [ docs] ( https://docs.github.com/en/graphql/reference/objects#ipallowlistentry ) for further information.
221
223
224
+ ## get-organization-language-count.sh
225
+
226
+ Get a total count of the primary language of repositories in an organization.
227
+
228
+ Example output:
229
+
230
+ ```
231
+ 21 Shell
232
+ 11 JavaScript
233
+ 11 Dockerfile
234
+ 10 C#
235
+ 4 Java
236
+ ```
237
+
222
238
## get-organization-members.sh
223
239
224
240
Gets a list of members and their role in an organization
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Usage: ./get-organization-language-count.sh <org>
4
+
5
+ if [ -z " $1 " ]; then
6
+ echo " Usage: $0 <org>"
7
+ exit 1
8
+ fi
9
+
10
+ org=$1
11
+
12
+ results=$( gh api graphql --paginate -F owner=" $org " -f query='
13
+ query ($owner: String!, $endCursor: String) {
14
+ organization(login: $owner) {
15
+ repositories(first: 100, after: $endCursor) {
16
+ totalCount
17
+ nodes {
18
+ nameWithOwner
19
+ languages(first: 1) {
20
+ nodes {
21
+ name
22
+ }
23
+ }
24
+ }
25
+ pageInfo {
26
+ endCursor
27
+ hasNextPage
28
+ }
29
+ }
30
+ }
31
+ }' )
32
+
33
+ echo $results >> results.json
34
+ # sum the nodes.name
35
+ echo $results | jq -r ' .data.organization.repositories.nodes[].languages.nodes[].name' | sort | uniq -c | sort -nr
You can’t perform that action at this time.
0 commit comments