{"id":22222343,"url":"https://github.com/misiektoja/github_monitor","last_synced_at":"2025-07-27T16:32:56.012Z","repository":{"id":239327943,"uuid":"799232009","full_name":"misiektoja/github_monitor","owner":"misiektoja","description":"Real-time tracking of Github users activities including profile and repositories changes","archived":false,"fork":false,"pushed_at":"2025-07-15T17:18:39.000Z","size":3663,"stargazers_count":27,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-16T13:33:15.932Z","etag":null,"topics":["github","github-api","github-monitor","osint","pygithub","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/misiektoja.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-11T14:23:29.000Z","updated_at":"2025-07-15T17:12:58.000Z","dependencies_parsed_at":"2024-05-17T19:31:17.928Z","dependency_job_id":"2800637e-9cd2-4086-9774-624b7e00cb06","html_url":"https://github.com/misiektoja/github_monitor","commit_stats":null,"previous_names":["misiektoja/github_monitor"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/misiektoja/github_monitor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misiektoja%2Fgithub_monitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misiektoja%2Fgithub_monitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misiektoja%2Fgithub_monitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misiektoja%2Fgithub_monitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/misiektoja","download_url":"https://codeload.github.com/misiektoja/github_monitor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misiektoja%2Fgithub_monitor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265618919,"owners_count":23799352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","github-api","github-monitor","osint","pygithub","python"],"created_at":"2024-12-02T23:18:04.405Z","updated_at":"2025-07-27T16:32:56.005Z","avatar_url":"https://github.com/misiektoja.png","language":"Python","readme":"# github_monitor\n\nOSINT tool for real-time monitoring of GitHub users' activities, including profile and repository changes.\n\n\u003ca id=\"features\"\u003e\u003c/a\u003e\n## Features\n\n- Real-time tracking of GitHub users' activities, including profile and repository changes:\n   - new GitHub events for the user like new pushes, PRs, issues, forks, releases, reviews etc.\n   - repository changes such as updated stargazers, watchers, forks, issues, PRs, description and repo update dates\n   - added/removed followings and followers\n   - added/removed starred repositories\n   - added/removed public repositories\n   - changes in user name, email, location, company, bio and blog URL\n   - changes in profile visibility (public to private and vice versa)\n   - detection when a user blocks or unblocks you\n   - detection of account metadata changes (such as account update date)\n- Email notifications for different events (new GitHub events, changed followings, followers, repositories, user name, email, location, company, bio, blog URL etc.)\n- Saving all user activities with timestamps to the CSV file\n- Clickable GitHub URLs printed in the console \u0026 included in email notifications (repos, PRs, commits, issues, releases etc.)\n- Possibility to control the running copy of the script via signals\n- Support for Public Web GitHub and GitHub Enterprise\n\n\u003cp align=\"center\"\u003e\n   \u003cimg src=\"https://raw.githubusercontent.com/misiektoja/github_monitor/refs/heads/main/assets/github_monitor.png\" alt=\"github_monitor_screenshot\" width=\"100%\"/\u003e\n\u003c/p\u003e\n\n\u003ca id=\"table-of-contents\"\u003e\u003c/a\u003e\n## Table of Contents\n\n1. [Requirements](#requirements)\n2. [Installation](#installation)\n   * [Install from PyPI](#install-from-pypi)\n   * [Manual Installation](#manual-installation)\n3. [Quick Start](#quick-start)\n4. [Configuration](#configuration)\n   * [Configuration File](#configuration-file)\n   * [GitHub Personal Access Token](#github-personal-access-token)\n   * [GitHub API URL](#github-api-url)\n   * [Events to Monitor](#events-to-monitor)\n   * [Time Zone](#time-zone)\n   * [SMTP Settings](#smtp-settings)\n   * [Storing Secrets](#storing-secrets)\n5. [Usage](#usage)\n   * [Monitoring Mode](#monitoring-mode)\n   * [Listing Mode](#listing-mode)\n   * [Email Notifications](#email-notifications)\n   * [CSV Export](#csv-export)\n   * [Check Intervals](#check-intervals)\n   * [Signal Controls (macOS/Linux/Unix)](#signal-controls-macoslinuxunix)\n   * [Coloring Log Output with GRC](#coloring-log-output-with-grc)\n6. [Change Log](#change-log)\n7. [License](#license)\n\n\u003ca id=\"requirements\"\u003e\u003c/a\u003e\n## Requirements\n\n* Python 3.10 or higher\n* Libraries: [PyGithub](https://github.com/PyGithub/PyGithub), `requests`, `python-dateutil`, `pytz`, `tzlocal`, `python-dotenv`\n\nTested on:\n\n* **macOS**: Ventura, Sonoma, Sequoia\n* **Linux**: Raspberry Pi OS (Bullseye, Bookworm), Ubuntu 24, Rocky Linux 8.x/9.x, Kali Linux 2024/2025\n* **Windows**: 10, 11\n\nIt should work on other versions of macOS, Linux, Unix and Windows as well.\n\n\u003ca id=\"installation\"\u003e\u003c/a\u003e\n## Installation\n\n\u003ca id=\"install-from-pypi\"\u003e\u003c/a\u003e\n### Install from PyPI\n\n```sh\npip install github_monitor\n```\n\n\u003ca id=\"manual-installation\"\u003e\u003c/a\u003e\n### Manual Installation\n\nDownload the *[github_monitor.py](https://raw.githubusercontent.com/misiektoja/github_monitor/refs/heads/main/github_monitor.py)* file to the desired location.\n\nInstall dependencies via pip:\n\n```sh\npip install PyGithub requests python-dateutil pytz tzlocal python-dotenv\n```\n\nAlternatively, from the downloaded *[requirements.txt](https://raw.githubusercontent.com/misiektoja/github_monitor/refs/heads/main/requirements.txt)*:\n\n```sh\npip install -r requirements.txt\n```\n\n\u003ca id=\"quick-start\"\u003e\u003c/a\u003e\n## Quick Start\n\n- Grab your [GitHub personal access token](#github-personal-access-token) and track the `github_username` activities:\n\n\n```sh\ngithub_monitor \u003cgithub_username\u003e -t \"your_github_classic_personal_access_token\"\n```\n\nOr if you installed [manually](#manual-installation):\n\n```sh\npython3 github_monitor.py \u003cgithub_username\u003e -t \"your_github_classic_personal_access_token\"\n```\n\nTo get the list of all supported command-line arguments / flags:\n\n```sh\ngithub_monitor --help\n```\n\n\u003ca id=\"configuration\"\u003e\u003c/a\u003e\n## Configuration\n\n\u003ca id=\"configuration-file\"\u003e\u003c/a\u003e\n### Configuration File\n\nMost settings can be configured via command-line arguments.\n\nIf you want to have it stored persistently, generate a default config template and save it to a file named `github_monitor.conf`:\n\n```sh\ngithub_monitor --generate-config \u003e github_monitor.conf\n\n```\n\nEdit the `github_monitor.conf` file and change any desired configuration options (detailed comments are provided for each).\n\n\u003ca id=\"github-personal-access-token\"\u003e\u003c/a\u003e\n### GitHub Personal Access Token\n\nGo to your GitHub Apps settings: [https://github.com/settings/apps](https://github.com/settings/apps)\n\nThen click **Personal access tokens → Tokens (classic) → Generate new token (classic)**.\n\nProvide the `GITHUB_TOKEN` secret using one of the following methods:\n - Pass it at runtime with `-t` / `--github-token`\n - Set it as an [environment variable](#storing-secrets) (e.g. `export GITHUB_TOKEN=...`)\n - Add it to [.env file](#storing-secrets) (`GITHUB_TOKEN=...`) for persistent use\n - Fallback: hard-code it in the code or config file\n\nIf you store the `GITHUB_TOKEN` in a dotenv file you can update its value and send a `SIGHUP` signal to reload the file with the new token without restarting the tool. More info in [Storing Secrets](#storing-secrets) and [Signal Controls (macOS/Linux/Unix)](#signal-controls-macoslinuxunix).\n\n\u003ca id=\"github-api-url\"\u003e\u003c/a\u003e\n### GitHub API URL\n\nBy default the tool uses Public Web GitHub API URL: [https://api.github.com](https://api.github.com)\n\nIf you want to use GitHub Enterprise API URL then change `GITHUB_API_URL` (or use `-x` flag) to: `https://{your_hostname}/api/v3`\n\n\n\u003ca id=\"events-to-monitor\"\u003e\u003c/a\u003e\n### Events to Monitor\n\nYou can limit the type of events that will be monitored and reported by the tool. You can do it by changing the `EVENTS_TO_MONITOR` configuration option.\n\nBy default all events are monitored, but if you want to limit it, then remove the `ALL` keyword and leave the events you are interested in, for example:\n\n```\nEVENTS_TO_MONITOR=['PushEvent','PullRequestEvent', 'IssuesEvent', 'ForkEvent', 'ReleaseEvent']\n```\n\n\u003ca id=\"time-zone\"\u003e\u003c/a\u003e\n### Time Zone\n\nBy default, time zone is auto-detected using `tzlocal`. You can set it manually in `github_monitor.conf`:\n\n```ini\nLOCAL_TIMEZONE='Europe/Warsaw'\n```\n\nYou can get the list of all time zones supported by pytz like this:\n\n```sh\npython3 -c \"import pytz; print('\\n'.join(pytz.all_timezones))\"\n```\n\u003ca id=\"smtp-settings\"\u003e\u003c/a\u003e\n### SMTP Settings\n\nIf you want to use email notifications functionality, configure SMTP settings in the `github_monitor.conf` file. \n\nVerify your SMTP settings by using `--send-test-email` flag (the tool will try to send a test email notification):\n\n```sh\ngithub_monitor --send-test-email\n```\n\n\u003ca id=\"storing-secrets\"\u003e\u003c/a\u003e\n### Storing Secrets\n\nIt is recommended to store secrets like `GITHUB_TOKEN` or `SMTP_PASSWORD` as either an environment variable or in a dotenv file.\n\nSet environment variables using `export` on **Linux/Unix/macOS/WSL** systems:\n\n```sh\nexport GITHUB_TOKEN=\"your_github_classic_personal_access_token\"\nexport SMTP_PASSWORD=\"your_smtp_password\"\n```\n\nOn **Windows Command Prompt** use `set` instead of `export` and on **Windows PowerShell** use `$env`.\n\nAlternatively store them persistently in a dotenv file (recommended):\n\n```ini\nGITHUB_TOKEN=\"your_github_classic_personal_access_token\"\nSMTP_PASSWORD=\"your_smtp_password\"\n```\n\nBy default the tool will auto-search for dotenv file named `.env` in current directory and then upward from it. \n\nYou can specify a custom file with `DOTENV_FILE` or `--env-file` flag:\n\n```sh\ngithub_monitor \u003cgithub_username\u003e --env-file /path/.env-github_monitor\n```\n\n You can also disable `.env` auto-search with `DOTENV_FILE = \"none\"` or `--env-file none`:\n\n```sh\ngithub_monitor \u003cgithub_username\u003e --env-file none\n```\n\nAs a fallback, you can also store secrets in the configuration file or source code.\n\n\u003ca id=\"usage\"\u003e\u003c/a\u003e\n## Usage\n\n\u003ca id=\"monitoring-mode\"\u003e\u003c/a\u003e\n### Monitoring Mode\n\nTo monitor specific user activities and profile changes, simply enter the GitHub username as a command-line argument (`github_username` in the example below):\n\n```sh\ngithub_monitor github_username\n```\n\nIt will track all user profile changes (e.g. changed followers, followings, starred repositories, username, email, bio, location, blog URL, number of repositories) and also all GitHub events (e.g. new pushes, PRs, issues, forks, releases etc.).\n\nIf you have not set `GITHUB_TOKEN` secret, you can use `-t` flag:\n\n```sh\ngithub_monitor github_username -t \"your_github_classic_personal_access_token\"\n```\n\nBy default, the tool looks for a configuration file named `github_monitor.conf` in:\n - current directory \n - home directory (`~`)\n - script directory \n\n If you generated a configuration file as described in [Configuration](#configuration), but saved it under a different name or in a different directory, you can specify its location using the `--config-file` flag:\n\n\n```sh\ngithub_monitor \u003cgithub_username\u003e --config-file /path/github_monitor_new.conf\n```\n\nIf you want to monitor changes to user's public repositories (e.g. new stargazers, watchers, forks, changed descriptions etc.) then use the `-j` flag:\n\n```sh\ngithub_monitor github_username -j\n```\n\nBy default, only user-owned repos are tracked. To include forks and collaborations, set `GET_ALL_REPOS` to `True` or use the `-a` flag:\n\n```sh\ngithub_monitor github_username -j -a\n```\n\nIf for any reason you do not want to monitor GitHub events for the user (e.g. new pushes, PRs, issues, forks, releases etc.), then use the `-k` flag:\n\n```sh\ngithub_monitor github_username -k\n```\n\nThe tool runs until interrupted (`Ctrl+C`). Use `tmux` or `screen` for persistence.\n\nYou can monitor multiple GitHub users by running multiple instances of the script.\n\nThe tool automatically saves its output to `github_monitor_\u003cusername\u003e.log` file. It can be changed in the settings via `GITHUB_LOGFILE` configuration option or disabled completely via `DISABLE_LOGGING` / `-d` flag.\n\n\u003ca id=\"listing-mode\"\u003e\u003c/a\u003e\n### Listing Mode\n\nThere is another mode of the tool that displays various requested information (`-r`, `-g`, `-f` and `-l` flags).\n\nIf you want to display a list of public repositories (with some basic statistics) for the user then use the `-r` flag:\n\n```sh\ngithub_monitor github_username -r\n```\n\n\u003cp align=\"center\"\u003e\n   \u003cimg src=\"https://raw.githubusercontent.com/misiektoja/github_monitor/refs/heads/main/assets/github_list_of_repos.png\" alt=\"github_list_of_repos\" width=\"90%\"/\u003e\n\u003c/p\u003e\n\nBy default, only user-owned repos are listed. To include forks and collaborations, set `GET_ALL_REPOS` to `True` or use the `-a` flag:\n\n```sh\ngithub_monitor github_username -r -a\n```\n\nIf you want to display a list of repositories starred by the user then use the `-g` flag:\n\n```sh\ngithub_monitor github_username -g\n```\n\nIf you want to display a list of followers and followings for the user then use the `-f` flag.\n\n```sh\ngithub_monitor github_username -f\n```\n\nIf you want to get the list of recent GitHub events for the user then use the `-l` flag. You can also add the `-n` flag to specify how many events should be displayed. By default, it shows the last 5 events.\n\n```sh\ngithub_monitor github_username -l -n 10\n```\n\nIf you want to not only display, but also save the list of recent GitHub events to a CSV file, use the `-l` flag with `-b` indicating the CSV file. As before, you can add the `-n` flag to specify how many events should be displayed/saved:\n\n```sh\ngithub_monitor github_username -l -n 10 -b github_username.csv\n```\n\n\u003ca id=\"email-notifications\"\u003e\u003c/a\u003e\n### Email Notifications\n\nTo enable email notifications for all user profile changes (e.g. changes in followers, followings, starred repositories, username, email, bio, location, blog URL and number of repositories):\n- set `PROFILE_NOTIFICATION` to `True`\n- or use the `-p` flag\n\n```sh\ngithub_monitor github_username -p\n```\n\nTo receive email notifications when new GitHub events appear for the user (e.g. new pushes, PRs, issues, forks, releases etc.):\n- set `EVENT_NOTIFICATION` to `True`\n- or use the `-s` flag\n\n```sh\ngithub_monitor github_username -s\n```\n\nTo get email notifications when changes in user repositories are detected (e.g. changes in stargazers, watchers, forks, descriptions, etc., except for the update date):\n- set `REPO_NOTIFICATION` to `True`\n- or use the `-q` flag\n\n```sh\ngithub_monitor github_username -q\n```\n\nTo be informed whenever changes in the update date of user repositories are detected:\n- set `REPO_UPDATE_DATE_NOTIFICATION` to `True`\n- or use the `-u` flag\n\n```sh\ngithub_monitor github_username -u\n```\n\nThe last two options (`-q` and `-u`) only work if tracking of repositories changes is enabled (`-j`).\n\nTo disable sending an email on errors (enabled by default):\n- set `ERROR_NOTIFICATION` to `False`\n- or use the `-e` flag\n\n```sh\ngithub_monitor github_username -e\n```\n\nYou can combine all email notifications flags together if needed.\n\nMake sure you defined your SMTP settings earlier (see [SMTP settings](#smtp-settings)).\n\nExample email:\n\n\u003cp align=\"center\"\u003e\n   \u003cimg src=\"https://raw.githubusercontent.com/misiektoja/github_monitor/refs/heads/main/assets/github_monitor_email_notifications.png\" alt=\"github_monitor_email_notifications\" width=\"90%\"/\u003e\n\u003c/p\u003e\n\n\u003ca id=\"csv-export\"\u003e\u003c/a\u003e\n### CSV Export\n\nIf you want to save all GitHub user events, profile changes and repository updates to a CSV file, set `CSV_FILE` or use `-b` flag:\n\n```sh\ngithub_monitor \u003cgithub_username\u003e -b github_username.csv\n```\n\nThe file will be automatically created if it does not exist.\n\n\u003ca id=\"check-intervals\"\u003e\u003c/a\u003e\n### Check Intervals\n\nIf you want to customize the polling interval, use `-c` flag (or `GITHUB_CHECK_INTERVAL` configuration option):\n\n```sh\ngithub_monitor \u003cgithub_username\u003e -c 900\n```\n\nIt is generally not recommended to use values lower than 10 minutes as new events are very often delayed by GitHub API.\n\n\u003ca id=\"signal-controls-macoslinuxunix\"\u003e\u003c/a\u003e\n### Signal Controls (macOS/Linux/Unix)\n\nThe tool has several signal handlers implemented which allow to change behavior of the tool without a need to restart it with new configuration options / flags.\n\nList of supported signals:\n\n| Signal | Description |\n| ----------- | ----------- |\n| USR1 | Toggle email notifications for all user's profile changes (-p) |\n| USR2 | Toggle email notifications for new GitHub events (-s) |\n| CONT | Toggle email notifications for user's repositories changes (except for update date) (-q) |\n| PIPE | Toggle email notifications for user's repositories update date changes (-u) |\n| TRAP | Increase the user check interval (by 1 min) |\n| ABRT | Decrease the user check interval (by 1 min) |\n| HUP | Reload secrets from .env file |\n\nSend signals with `kill` or `pkill`, e.g.:\n\n```sh\npkill -USR1 -f \"github_monitor \u003cgithub_username\u003e\"\n```\n\nAs Windows supports limited number of signals, this functionality is available only on Linux/Unix/macOS.\n\n\u003ca id=\"coloring-log-output-with-grc\"\u003e\u003c/a\u003e\n### Coloring Log Output with GRC\n\nYou can use [GRC](https://github.com/garabik/grc) to color logs.\n\nAdd to your GRC config (`~/.grc/grc.conf`):\n\n```\n# monitoring log file\n.*_monitor_.*\\.log\nconf.monitor_logs\n```\n\nNow copy the [conf.monitor_logs](https://raw.githubusercontent.com/misiektoja/github_monitor/refs/heads/main/grc/conf.monitor_logs) to your `~/.grc/` and log files should be nicely colored when using `grc` tool.\n\nExample:\n\n```sh\ngrc tail -F -n 100 github_monitor_\u003cusername\u003e.log\n```\n\n\u003ca id=\"change-log\"\u003e\u003c/a\u003e\n## Change Log\n\nSee [RELEASE_NOTES.md](https://github.com/misiektoja/github_monitor/blob/main/RELEASE_NOTES.md) for details.\n\n\u003ca id=\"license\"\u003e\u003c/a\u003e\n## License\n\nLicensed under GPLv3. See [LICENSE](https://github.com/misiektoja/github_monitor/blob/main/LICENSE).\n","funding_links":[],"categories":["Social Media Tools"],"sub_categories":["[↑](#-table-of-contents) GitHub"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisiektoja%2Fgithub_monitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmisiektoja%2Fgithub_monitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisiektoja%2Fgithub_monitor/lists"}