One-command GitHub to Discord notifications: manage repo webhooks that post straight to your Discord channels.
Project description
gh2discord
Wire GitHub repos to Discord channels with one command.
Discord can render GitHub webhook payloads natively — no bot, no middleware.
The only friction is the manual setup: create a Discord webhook, copy the URL,
open every repo's settings, paste the URL with a magic /github suffix.
gh2discord automates the GitHub side and remembers your Discord channels,
so tracking a new repo becomes:
gh2discord track owner/repo
Install
pipx install gh2discord # recommended
# or
pip install gh2discord
Zero runtime dependencies. Python 3.9+.
Setup (once)
- In Discord: Channel settings → Integrations → Webhooks → New Webhook, copy the webhook URL.
- Register it:
gh2discord channel add general https://discord.com/api/webhooks/<id>/<token> --default
- Authenticate with GitHub — any one of:
ghCLI already logged in (nothing to do; the token is picked up automatically), orGITHUB_TOKEN/GH_TOKENenvironment variable.- Classic PAT:
repooradmin:repo_hookscope. - Fine-grained PAT: Webhooks (write) + Metadata (read) on the repos you track.
- Classic PAT:
You can only track repos you administer — GitHub allows webhook management for repo admins only.
Usage
gh2discord track owner/repo # default channel, all events
gh2discord track owner/repo --events push,release,issues,pull_request
gh2discord track owner/repo --channel alerts # per-repo channel
gh2discord list # tracked repos
gh2discord status # live hook health (last delivery)
gh2discord ping owner/repo # end-to-end delivery test
gh2discord untrack owner/repo # remove the hook
track is idempotent: run it twice and you get one hook, not two. It also
repairs broken hooks in place (wrong content type, disabled, or stale events).
If the repo already has Discord hooks pointing at different webhooks,
gh2discord warns and leaves them alone unless you pass --force, which
retargets one and deletes the rest.
Multiple channels work without any bot: register each channel's webhook once
(channel add), then route repos with --channel.
gh2discord channel add releases https://discord.com/api/webhooks/<id>/<token>
gh2discord track owner/lib --channel releases --events release
Notes
- Config lives at
%APPDATA%\gh2discord\config.json(Windows) or~/.config/gh2discord/config.json(Linux/macOS). Discord webhook URLs are secrets — the file is written with owner-only permissions on POSIX; don't commit it anywhere. --events all(the default) sends everything GitHub emits; Discord silently ignores event types it can't render. Use an explicit list for quieter channels.- GitHub returns 404 (not 403) when your token lacks webhook access to a repo — if a repo you own reports "not found", check your token scopes first.
Roadmap
--botmode: create the Discord channel + webhook automatically (bot token).- Polling mode for repos you don't administer (releases/commits feeds).
- Org-wide webhook helper for organization accounts.
License & Attribution
MIT © Ozan Eski — free for everyone and every use, personal or commercial. The one requirement (per the MIT license terms): if you copy, modify, or redistribute this code or a substantial portion of it, you must keep the copyright notice — credit Ozan Eski / gh2discord and link back to this repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gh2discord-0.1.0.tar.gz.
File metadata
- Download URL: gh2discord-0.1.0.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
667c365b26b7e4ead4da4e267afb79bd8b7a46c701699332e4b88030aa6fb9f9
|
|
| MD5 |
2bb8f74ccca8772adfe0e17daaae9ecd
|
|
| BLAKE2b-256 |
b0f7c6a5bbf36b3da7a12054236474beea7bba7deaaa4b13ff95edaeb22ed164
|
Provenance
The following attestation bundles were made for gh2discord-0.1.0.tar.gz:
Publisher:
publish.yml on ozaneski13/gh2discord
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gh2discord-0.1.0.tar.gz -
Subject digest:
667c365b26b7e4ead4da4e267afb79bd8b7a46c701699332e4b88030aa6fb9f9 - Sigstore transparency entry: 2339165871
- Sigstore integration time:
-
Permalink:
ozaneski13/gh2discord@062bcb6979e1deea0daadd60602b8a712d400863 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ozaneski13
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@062bcb6979e1deea0daadd60602b8a712d400863 -
Trigger Event:
release
-
Statement type:
File details
Details for the file gh2discord-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gh2discord-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb25c4c6bc1cef20f78643264d6496b366621f41ba122a32c4cbb8cba2020702
|
|
| MD5 |
3c5f7387f0d013e1d41941d438a585d0
|
|
| BLAKE2b-256 |
ac89b4a96d1fbfdea4bcf2a5dee93a56466d7b7acf80c592d95009451f247340
|
Provenance
The following attestation bundles were made for gh2discord-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on ozaneski13/gh2discord
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gh2discord-0.1.0-py3-none-any.whl -
Subject digest:
bb25c4c6bc1cef20f78643264d6496b366621f41ba122a32c4cbb8cba2020702 - Sigstore transparency entry: 2339165887
- Sigstore integration time:
-
Permalink:
ozaneski13/gh2discord@062bcb6979e1deea0daadd60602b8a712d400863 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ozaneski13
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@062bcb6979e1deea0daadd60602b8a712d400863 -
Trigger Event:
release
-
Statement type: