A middleware designed to sort your repositories into forum posts.
Screenshot
- If you have a lot of projects on your GitHub and you don't want to clog up one channel with all of it but you also don't want to create too many channels for all your repository feeds.
- Deploy with Workers
- 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. Make sure to set content type to àpplication/json` and also match the secret you set in the environment variables.
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