{"id":26490234,"url":"https://github.com/mdrxy/commit-to-discord","last_synced_at":"2026-04-12T09:44:33.342Z","repository":{"id":282789809,"uuid":"949660795","full_name":"mdrxy/commit-to-discord","owner":"mdrxy","description":"Watch GitHub repositories for commits and forward them to a Discord channel","archived":false,"fork":false,"pushed_at":"2025-07-01T19:12:49.000Z","size":105,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-07T16:59:38.420Z","etag":null,"topics":["github-api","python","webhook"],"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/mdrxy.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}},"created_at":"2025-03-16T23:30:56.000Z","updated_at":"2025-07-01T19:12:52.000Z","dependencies_parsed_at":"2025-03-17T00:27:57.512Z","dependency_job_id":"85086ccf-0884-4232-9007-12c702f4a5a1","html_url":"https://github.com/mdrxy/commit-to-discord","commit_stats":null,"previous_names":["mdrxy/commit-to-discord"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mdrxy/commit-to-discord","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdrxy%2Fcommit-to-discord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdrxy%2Fcommit-to-discord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdrxy%2Fcommit-to-discord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdrxy%2Fcommit-to-discord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdrxy","download_url":"https://codeload.github.com/mdrxy/commit-to-discord/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdrxy%2Fcommit-to-discord/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264619679,"owners_count":23638498,"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-api","python","webhook"],"created_at":"2025-03-20T07:57:28.187Z","updated_at":"2026-04-12T09:44:33.335Z","avatar_url":"https://github.com/mdrxy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# commit-to-discord\n\nMonitors specified GitHub repositories for new commits and sends detailed notifications to a Discord webhook. The notifications are designed to mirror Discord's first-party GitHub embed style (achieved by appending `/github` to a Discord webhook from within GitHub).\n\n## Key Features\n\n* **Multi-Repository \u0026 Multi-Branch Monitoring:** Keep track of commits across several repositories and selected branches.\n* **Persistent Tracking:** Remembers the last notified commit for each branch to avoid duplicates, even after restarts (using `last_commits.json`).\n* **Configurable:** Set repository list, webhook URL, polling interval, and GitHub token via environment variables.\n* **Containerized:** Easy to deploy and run using Docker or Podman, with `Makefile` targets for building, running, and management.\n* **GitHub API Token Support:** Use a [GitHub Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) for higher API rate limits or to access private repositories.\n\n## Example Discord Notification\n\n![Screenshot of an example Discord Notification using commit-to-discord](/img/example.png)\n\n## Prerequisites\n\n* [Docker](https://www.docker.com/) (or [Podman](https://podman.io/)) installed.\n* A [Discord Webhook](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) URL.\n* Repositories to monitor on GitHub.\n\n## Setup \u0026 Configuration\n\n1. **Clone the repository**\n\n    ```bash\n    git clone https://github.com/mdrxy/commit-to-discord.git\n    cd commit-to-discord\n    ```\n\n2. **Create an environment file:**\n    Copy `.sample.env` to `.env`:\n\n    ```bash\n    cp .sample.env .env\n    ```\n\n3. **Fill in `.env` with your settings:**\n\n    * `GITHUB_REPOS`: A comma-separated list of GitHub repositories to monitor.\n      * Format: `owner1/repo1,owner2/repo2`\n      * Example: `AzuraCast/AzuraCast,mdrxy/commit-to-discord`\n    * `DISCORD_WEBHOOK_URL`: Your Discord channel's webhook URL.\n    * `GITHUB_TOKEN` (Optional): Your GitHub Personal Access Token. Recommended for private repositories or to avoid rate limiting on public repositories with frequent checks.\n    * `POLL_INTERVAL_SECONDS` (Optional): How often (in seconds) to check for new commits.\n      * Defaults to `120` (2 minutes).\n      * Be mindful of GitHub API rate limits (60 requests/hour unauthenticated per IP, 5000/hour authenticated). The script makes one request per branch per repository during each poll.\n    * `BRANCH_BLACKLIST` (Optional): A comma-separated list of branch patterns to ignore.\n      * **Global patterns:** Apply to all repositories (e.g., `main,develop`).\n      * **Repository-specific patterns:** Apply to a single repository (e.g., `owner/repo:main,owner/repo:develop`).\n      * **Wildcards:** Supported for pattern matching (e.g., `release/*, feature-*`).\n      * Example: `dependabot/*,mdrxy/commit-to-discord:main` will ignore all `dependabot` branches in every repository and the `main` branch in `mdrxy/commit-to-discord`.\n    * `LOG_LEVEL` (Optional): Set the logging level (e.g., `DEBUG`, `INFO`, `WARNING`, `ERROR`). Defaults to `INFO`.\n    * `LOG_TZ` (Optional): Set the timezone for log timestamps. Defaults to UTC.\n\n## Usage\n\nThe provided `Makefile` simplifies deployment operations. [(Install `make`)](https://www.gnu.org/software/make/)\n\n* **Build and Run (Recommended):**\n\n    ```bash\n    make\n    ```\n\n    This will clean any previous instances, build the image, run the container in detached mode, and start following logs.\n\n* **Using Podman:**\n    It's assumed you're using Docker, but if you prefer Podman, you can set the `DOCKER_TOOL` environment variable to `podman` to seamlessly switch containerization tools:\n\n    ```bash\n    DOCKER_TOOL=podman make\n    ```\n\n### Manual Build Commands\n\n* **Build the image:**\n\n    ```bash\n    docker build -t commit-to-discord-image .\n    ```\n\n* **Run the container:**\n\n    ```bash\n    docker run -d --restart unless-stopped \\\n      --name commit-to-discord \\\n      --env-file .env \\\n      commit-to-discord-image\n    ```\n\n    *Note: The `Makefile` passes `LOG_LEVEL` as an environment variable (`-e LOG_LEVEL=$(LOG_LEVEL)`). If running manually and you need to adjust `LOG_LEVEL` (default 'info' in `utils/logging.py`), you can add `-e LOG_LEVEL=debug` or similar to the `docker run` command.*\n\n### Makefile Targets\n\n* `make` or `make default`: Cleans, builds, runs, and tails logs.\n* `make q`: Quick build and run (cleans first).\n* `make build`: Builds the Docker image (`commit-to-discord-image`).\n* `make run`: Runs the Docker container (`commit-to-discord`) in detached mode. Stops existing container first.\n* `make start`: Alias for `run`.\n* `make stop`: Stops and removes the Docker container.\n* `make clean`: Stops and removes the container, then removes the Docker image.\n* `make logsf`: Follows the logs of the running container.\n* `make exec`: Attaches a shell to the running container for debugging.\n\n## Logging\n\nLog level can be controlled via the `LOG_LEVEL` environment variable (e.g., `INFO`, `DEBUG`, `WARNING`). Logs are output in color to the console (Docker logs) with timestamps in Eastern Time.\n\n## Development\n\n### Local Development Setup\n\nFor local development without Docker:\n\n1. **Install dependencies:**\n\n   ```bash\n   make setup-dev\n   ```\n\n   This installs all development dependencies and sets up pre-commit hooks.\n\n2. **Run quality checks:**\n\n   ```bash\n   make check-all    # Run linting, type checking, and format checking\n   make lint         # Run linting only\n   make typecheck    # Run type checking only\n   make format       # Format code\n   ```\n\n3. **Run the application locally:**\n\n   ```bash\n   # Copy and configure environment\n   cp .sample.env .env\n   # Edit .env with your settings\n   \n   # Run the application\n   uv run python commit_watcher.py\n   ```\n\n### Available Make Targets\n\n**Development:**\n\n* `make setup-dev`: Install dev dependencies and set up pre-commit\n* `make install-dev`: Install development dependencies only\n* `make check-all`: Run all quality checks\n\n**Code Quality:**\n\n* `make lint`: Check code with ruff\n* `make lint-fix`: Fix linting issues automatically\n* `make format`: Format code with ruff\n* `make format-check`: Check if code is properly formatted\n* `make typecheck`: Run mypy type checking\n\n**Pre-commit:**\n\n* `make pre-commit-install`: Install pre-commit hooks\n* `make pre-commit-run`: Run pre-commit on all files\n\n**Docker (existing):**\n\n* `make`: Full build and run workflow\n* `make build`: Build Docker image\n* `make run`: Run container\n* `make stop`: Stop container\n* `make clean`: Remove container and image\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a pull request or open an issue for any bugs or feature requests. I'll do my best to address them promptly.\n\n### Development Workflow\n\n1. Fork the repository\n2. Run `make setup-dev` to set up your development environment\n3. Make your changes\n4. Run `make check-all` to ensure code quality\n5. Commit your changes (pre-commit hooks will run automatically)\n6. Push and create a pull request\n\nThe CI pipeline will automatically run linting, type checking, security checks, and Docker build tests on all pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdrxy%2Fcommit-to-discord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdrxy%2Fcommit-to-discord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdrxy%2Fcommit-to-discord/lists"}