This repository provides an integration between Discord and GitHub Projects, allowing users to discuss GitHub Projects directly from Discord. Whenever a new issue, pull request or draft issue is added to the project, bot creates a new thread in the specified Discord channel. Every update to the project item is then communicated in the thread, allowing users to stay up-to-date with the latest changes.
This repository contains two main components:
server.py: listens for GitHub webhook events and processes thembot.py: a Discord bot that creates threads and posts updates
For local development, you can copy the .env.example file to .env and fill in the first three environment variables.
Then run the following command to install dependencies:
uv syncTo run the server and bot locally, you can use the following command:
uv run start-appTo run all tests, including unit tests, integration tests and e2e tests, use the following command:
uv run pytestFor deployment follow these steps:
- set all environment variables accordingly,
- setup file_mount for volumes specified in
docker-compose.yamlon /app/path_set_in_env, - set up a webhook in your GitHub repository to point to your server's
/webhook_endpointendpoint, - use Dockerfile to build the image.
- GitHub sends a webhook event to the server when an issue, pull request or draft issue is added or updated in the project.
- The server processes the event and extracts relevant information, such as the issue title, description
- The server updates shared state with the new information which is then used by the bot to post updates.
- The bot creates a new thread in the specified Discord channel for new issues, pull requests or draft issues.
- The bot posts updates in the thread whenever the issue, pull request or draft issue is updated.
- The bot uses the
github_usernames_to_discord_id_mapping.jsonfile to map GitHub usernames to Discord user IDs, allowing it to mention users in the thread.