Skip to content

A middleware designed to sort your repository feeds into Discord forum posts. Built with Cloudflare Workers

License

Notifications You must be signed in to change notification settings

GavinDR1/gitcord-forum

This branch is 14 commits ahead of, 189 commits behind biaw/gitcord-forum:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

124efc4 · Jul 14, 2024
Jul 13, 2024
Dec 7, 2022
Feb 27, 2023
Dec 7, 2022
Dec 7, 2022
Feb 13, 2023
Jul 8, 2024
Dec 7, 2022
Feb 13, 2023
Jul 12, 2024
Jul 12, 2024
Aug 25, 2023
Sep 24, 2023

Repository files navigation

Deploy Linting DeepScan grade GitHub Issues GitHub Pull Requests

Gitcord Forum Deploy to Cloudflare Workers

A middleware designed to sort your repositories into forum posts.

Screenshot Image of the forum channel on Discord

Usage examples

  • 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.

Setting up with Workers

  1. Deploy with Workers
  2. Insert the environment variables listed in the wrangler.toml file. You can either use the wrangler command, or do it through the worker dashboard.
  3. 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.

How the middleware works

Loading
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

About

A middleware designed to sort your repository feeds into Discord forum posts. Built with Cloudflare Workers

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%