Instead of having a single Discord channel for all your GitHub repository feeds, or having a separate tech channel for each repository, you can use this worker to create a forum post for each repository and sort your GitHub activity into those forum posts individually. This way, you can have a single channel for all your GitHub activity, but still keep it organized by repository - and users can easily follow the forum posts that they are interested in.
Screenshot

- Deploy to Cloudflare Workers using the button above.
- Insert the environment variables listed in the
wrangler.toml
file. You can either use thewrangler
command, or do it through the worker dashboard. - Add your new worker URL (
https://gitcord-forum.WORKER_SUBDOMAIN.workers.dev/
) as a webhook in your GitHub repository settings with your preferred set of notifications to get from the repository. Make sure to set content type toapplication/json
and also match the secret you set in the environment variables.- You can also add this URL as a webhook for your entire GitHub organization!
sequenceDiagram
autonumber
participant G as GitHub
participant W as Cloudflare Worker & Storage
participant D as Discord Webhook
activate G
G->>W: Send a Webhook event
activate W
alt signature header is not valid
W->>G: 401 Unauthorized
end
alt event is not a repository event
W->>G: 200 OK
end
W->>W: Find thread ID for repository
alt no forum thread exists
W->>D: Create a new forum thread and send first message
D->>W: Return message data with thread ID
W->>W: Save thread ID and message ID
else forum thread exists
W->>D: Update first forum message with new information
end
W->>D: Forward GitHub event to new or existing forum thread
W->>G: 200 OK