Skip to content

Commit fe8d642

Browse files
committed
Adding a couple of new scripts
1 parent 8f5535c commit fe8d642

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
. ./.gh-api-examples.conf
2+
3+
# https://cli.github.com/manual/gh_api
4+
5+
export GH_TOKEN=${GITHUB_TOKEN}
6+
7+
gh api graphql --paginate -F owner="${org}" -f query='
8+
query($owner: String!, $cursor: String) {
9+
organization(login: $owner) {
10+
projectsV2(first: 10, after: $cursor) {
11+
nodes {
12+
id
13+
title
14+
createdAt
15+
updatedAt
16+
}
17+
pageInfo {
18+
endCursor
19+
hasNextPage
20+
}
21+
}
22+
}
23+
}'
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
. ./.gh-api-examples.conf
2+
3+
# https://docs.github.com/en/enterprise-cloud@latest/rest/enterprise-admin/license?apiVersion=2022-11-28#list-enterprise-consumed-licenses
4+
# GET /enterprises/{enterprise}/consumed-licenses
5+
6+
7+
curl ${curl_custom_flags} \
8+
-H "X-GitHub-Api-Version: ${github_api_version}" \
9+
-H "Accept: application/vnd.github.v3+json" \
10+
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
11+
"${GITHUB_API_BASE_URL}/enterprises/${enterprise}/consumed-licenses" | jq -r '(["github_com_login", "github_com_name", "github_com_saml_name_id"], (.users[] | [.github_com_login, .github_com_name, .github_com_saml_name_id])) | @csv'
12+

0 commit comments

Comments
 (0)