See the blog post https://zonca.dev/2021/10/monitor-github-traffic.html
Rename tok-sample.sh
to tok.sh
and fill it in with a:
- Github Access Token
- Github username
- Github organization
Test it with:
bash collect_data.sh repository_name
This should create a folder with the name of your repository, download the stats and commit them to the repository.
See the pysm
folder for example output
Then create an entry in a user crontab with crontab -e
with the content of crontab.sh
Specify as argument to collect_data.sh
the repository name.
Use the merge_csv.sh
script from https://github.com/nchah/github-traffic-stats/blob/master/bash/merge-csv.sh