Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created April 9, 2023 19:09
Show Gist options
  • Save KyMidd/f08bca5669af2c68e86e0bdbad223285 to your computer and use it in GitHub Desktop.
Save KyMidd/f08bca5669af2c68e86e0bdbad223285 to your computer and use it in GitHub Desktop.
# Grab Org info to get repo counts
curl -sL \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/$GH_ORG > org_info.json
# Filter org info to get repo counts
PRIVATE_REPO_COUNT=$(cat org_info.json | jq -r '.owned_private_repos')
PUBLIC_REPO_COUNT=$(cat org_info.json | jq -r '.public_repos')
TOTAL_REPO_COUNT=$(($PRIVATE_REPO_COUNT + $PUBLIC_REPO_COUNT))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment