Skip to content

Instantly share code, notes, and snippets.

@jmcerrejon
Created April 27, 2021 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmcerrejon/b790c2f7c1910615dddc17140cd09ab2 to your computer and use it in GitHub Desktop.
Save jmcerrejon/b790c2f7c1910615dddc17140cd09ab2 to your computer and use it in GitHub Desktop.
Get repo info from GitHub
# brew install curl jq
# More info at: https://docs.github.com/en/rest/reference/repos#list-forks
repo_info() {
if [[ $1 == "" ]]; then
echo "Please, input a repo. Ex: jmcerrejon/pikiss"
return 0
fi
curl -H 'Accept: application/vnd.github.v3+json' \
"https://api.github.com/repos/$1/forks?sort=newest" | # sort = newest, oldest, or stargazers
jq '.[] | {name: .full_name, updated: .updated_at, stars: .stargazers_count}'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment