Created
March 25, 2019 14:05
-
-
Save fabiand/b5f3008c593760a7e9fbd32afdfd9215 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
export LC_ALL=C | |
_api() { curl -s -H "Authorization: token $GH_TOKEN" https://api.github.com/$1 ; } | |
_org() { _api orgs/kubevirt/$1 ; } | |
_repos() { _api repos/kubevirt/$1 ; } | |
_kubevirt_pulls() { _repos kubevirt/pulls ; } | |
#_kubevirt_pulls | jq ".[] | select((.assignees | length) == 0).issue_url" ; exit | |
REPOS="$(_org repos)" | |
repos() { cat <<<$REPOS ; } | |
date | |
K_STARS=$(repos | jq '.[] | select(.name == "kubevirt").stargazers_count') | |
#echo "All stars" | |
ORG_STARS=$(repos | jq 'reduce .[].stargazers_count as $item (0; . + $item)') | |
K_FORKS=$(repos | jq '.[] | select(.name == "kubevirt").forks_count') | |
#echo "All forks" | |
ORG_FORKS=$(repos | jq 'reduce .[].forks_count as $item (0; . + $item)') | |
echo -e "$(date +%d-%b-%Y)\tTBD\t$K_STARS\t$ORG_STARS\t$K_FORKS\t$ORG_FORKS" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment