In this tutorial, I have created a shell script that checks for all public repositories under a GitHub account and sends a notification email. The script can be scheduled under the cronjobs to automate this.
Pre-Requisiteis
This script uses Curl and SendEmail command line utilities. So make sure you have installed both packages on your system. The curl command is used to call GitHub API and SendEmail is used for sending email via the SMTP server.
Create a Shell Script
I have already created a bash script for you. You can simply copy the script and write it in a file on your system. On successful execution, if the script found any public repository in your GitHub account. You will get an email notification in your mailbox.
Schedule Script with Crontab
You can schedule this script to run daily, weekly, or twice a week. The following crontab example will run this script daily at 12:00 AM.
Conclusion
It is most important to keep our hard work safe. This script will alert you to the pubic repositories in your GitHub account. You can modify the script as per your requirements. You can also provide your enhancement via the comments. Also provide your feedback about this script, which encourages us to write more.