Skip to content

hifly81/github-utils

Repository files navigation

Github utils

Github API Reference:

How to use

Populate config file with:

  • github_access_token: personal access token: To create one follow instructions at: https://github.com/settings/personal-access-tokens
  • github_owner: github handle where the repository exists
  • github_repo: github repositories (separated by ,) to fetch stats

example config file:

github_access_token="XXXXXXXX"
github_owner="hifly81"
github_repo="kafka-examples,saga-pattern-demo"

Page views

Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday.

Daily basis:

$ page_views_last14days.sh

Weekly basis:

$ page_views_last14days_perweek.sh

Top referral sources

Get the top 10 referrers over the last 14 days.

$ top10_path_last14days.sh

Top referral paths

Get the top 10 popular contents over the last 14 days.

$ top10_referrers_last14days.sh

Delete Workflow Run

Utility to run a mass deletion of GitHub Actions workflow runs

$ delete_all_workflows_run.sh

Telegram notifications

Script telegram_notifications.sh will send a report with page views and top referral to your Telegram Bot Channel.

Populate telegram_notifications.sh file with:

  • BOT_TOKEN: Telegram Bot Token
  • CHAT_ID: Telegram Bot Chat ID
$ telegram_notifications.sh

Crontab

This example with crontab will schedule the creation of a report with last 14 days pageviews every day at 2:30pm

30  14  *   *   *   ${SCRIPT_FOLDER}/page_views_last14days.sh >> ${OUTPUT_FOLDER}/"pageviews14days_$(date +\%Y-\%m-\%d).log"

Releases

No releases published

Packages

No packages published

Languages