A lightweight Python tool to watch GitHub repositories for activity and send instant alerts to your favorite service (Telegram, Slack, Pushover, Twilio, etc.) using Apprise.
- Rename
.env.exampleto.env. - Open
.envand fill in your details:- NOTIFICATION_URLS: A comma-separated list of Apprise service URLs.
- Telegram:
tgram://BOT_TOKEN/CHAT_ID - Discord:
discord://WEBHOOK_ID/WEBHOOK_TOKEN - Slack:
slack://TOKEN/A/B/C - Email:
mailto://user:password@smtp.gmail.com - Pushover:
pover://USER_KEY@TOKEN - Pushbullet:
pbul://ACCESS_TOKEN - Twilio SMS:
twilio://ACCOUNT_SID:AUTH_TOKEN@FROM_PHONE/TO_PHONE - For a full list of 100+ supported services and their URL formats, see the Apprise Wiki.
- Telegram:
- GITHUB_TOKEN: (Optional but recommended) Generate a Personal Access Token on GitHub (Settings -> Developer Settings -> Personal access tokens).
- GITHUB_REPOS: Comma-separated list of repositories to watch (e.g.,
torvalds/linux, google/guava). - GITHUB_USER: (Optional) Set this to a GitHub username to automatically monitor all their public repositories.
- EXCLUDE_ARCHIVED: (Optional) Set to
Yto ignore archived repositories. - EXCLUDE_REPOS: (Optional) Comma-separated list of repositories to exclude from monitoring.
- CHECK_INTERVAL: Time in seconds between checks (default
600).
- NOTIFICATION_URLS: A comma-separated list of Apprise service URLs.
Run the gitnot using uv:
uv run monitor.py-
Make sure you have
dockeranddocker-composeinstalled. -
Run the container in detached mode:
docker-compose up -d
-
Check the logs:
docker-compose logs -f
-
Build the image:
docker build -t gitnot . -
Run the container (mounting state.json for persistence):
docker run -d \ --name gitnot \ --env-file .env \ -v $(pwd)/state.json:/app/state.json \ gitnot
If you prefer to schedule the execution yourself (e.g., via cron), you can use the --no-sleep flag. This will make the script check for updates once and then exit immediately.
# Run once and exit
uv run monitor.py --no-sleepExample Crontab (every 10 minutes):
*/10 * * * * cd /path/to/gitnot && uv run monitor.py --no-sleep >> /var/log/gitnot.log 2>&1- First Run: The gitnot will log "First run detected" and initialize
state.jsonwith the latest event IDs for your repos. No notifications will be sent to avoid spamming old events. - Subsequent Runs: The gitnot will continuously check for new events.
- Testing:
- Star one of your watched repos (or unstar and star again).
- Wait for the
CHECK_INTERVAL(default 60s). - You should receive a Telegram message!
state.jsonstores the progress. If you want to reset the gitnot to fetch "everything new" again (or just reset history), delete this file.- Logs are printed to the console.
The script will combine them:
- Union: It monitors repositories listed in
GITHUB_REPOSPLUS all public repositories found forGITHUB_USER. - No Duplicates: If a repository exists in both, it is only monitored once.
- Exclusions Apply Last: Any repositories listed in
EXCLUDE_REPOS(or archived ones ifEXCLUDE_ARCHIVED=Y) are removed from the final list.