Created
April 27, 2021 16:45
-
-
Save jmcerrejon/b790c2f7c1910615dddc17140cd09ab2 to your computer and use it in GitHub Desktop.
Get repo info from GitHub
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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