forked from mindee/devrel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
github-stars.sh
executable file
·52 lines (44 loc) · 1.22 KB
/
github-stars.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#! /bin/bash
#
# Script to get stars from our repositories for our KPI Dashboard
#
# You can get your token at https://github.com/settings/tokens
# Configure a global variable named GITHUB_USERNAME with your GitHub username
# Configure a global variable named GITHUB_STARS_TOKEN with the token you just created
#
org="mindee"
repos=(
"demo-Nodejs-SDK"
"demo-plates-DVLA"
"devrel"
"doctr"
"integration-zapier"
"integration-microsoft-flow"
"mindee-api-python"
"mindee-js"
"notebooks"
"react-mindee-js"
"mindee-api-nodejs"
"tf-builds"
"vue-mindee-js"
)
###################################
# Do not modify beyong this point #
###################################
api_url="https://api.github.com/repos/"
bold=$(tput bold)
normal=$(tput sgr0)
printf "\n%s\n" "----------------------"
echo "| Repositories Stars |"
printf "%s\n" "----------------------"
# looping the repos
for repo in "${repos[@]}"
do
stars=$(curl --silent -u $GITHUB_USERNAME:$GITHUB_STARS_TOKEN "$api_url$org/$repo" | jq '.stargazers_count')
printf "%s\n" "${bold}$repo:${normal} $stars"
excel="$excel$stars,"
done
printf "\n\n%s\n" "-------------"
echo "| Excel CSV |"
printf "%s\n" "-------------"
echo "$excel"