Go to file
Jakub Sokołowski 9c93589031
allow overriding PORT in docker compose
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2024-04-30 12:49:39 +02:00
.github docs: update readme once more 2022-09-04 16:13:06 +02:00
lib feat: transform `:emoji:` in text to unicode emoji 2024-02-01 17:59:54 +01:00
.dockerignore feat: add docker stuff 2022-09-03 02:19:54 +02:00
.env.example feat: use redis to fix state sync issues 2022-09-06 21:21:40 +02:00
.gitignore Initial commit 2022-09-03 02:19:53 +02:00
.pre-commit-config.yaml fix: update pre-commit hook file types 2022-09-03 02:19:54 +02:00
Dockerfile grant deno user permission to write to app folder used if the dockerfile 2024-04-26 12:09:22 +02:00
LICENSE docs: add readme and license 2022-09-03 02:19:54 +02:00
README.md chore: update fmt config 2023-07-10 21:29:49 +02:00
deno.json update deno version 2024-04-22 15:50:13 +02:00
deno.lock update deno version 2024-04-22 15:50:13 +02:00
deps.ts feat: transform `:emoji:` in text to unicode emoji 2024-02-01 17:59:54 +01:00
docker-compose.yml allow overriding PORT in docker compose 2024-04-30 12:49:39 +02:00
main.ts fix: log if url signing is enabled (not disabled) 2024-02-01 17:32:59 +01:00

README.md

github-webhook-filter

A webhook filter for Deno that filters GitHub events before forwarding them to a Discord webhook, reducing noise.
Additionally, it attempts to handle Discord ratelimits and resend the webhook events if needed, instead of just dropping the requests like GitHub does.

Certain no-op events (which Discord would ignore anyway) and common CI bots are ignored by default; see configuration below for more.

Usage

  1. Host the project somewhere, for example https://deno.com/deploy. Remember to add the environment variables you may want to set, see lib/config.ts.
  2. Create a Discord webhook (https://discord.com/api/webhooks/1234/ABCDWXYZ).
  3. Take the ID (1234) and token (ABCDWXYZ) from the URL, and enter https://<filter_url>/1234/ABCDWXYZ (note: no /github) in the GitHub webhook settings:
    settings
  4. Optionally add configuration parameters (see below) to the URL, e.g. ?allowBranches=master,dev&hideTags=1.
  5. ????
  6. Profit!

Configuration

Additional options can be configured per URL:

  • Only forward events from specific branches (allowBranches, simplified wildcard syntax)
    • abc*xyz is equivalent to /^(abc.*xyz)$/
    • stuff,things is equivalent to /^(stuff|things)$/
    • !oh*hi*there is equivalent to /^(oh.*hi.*there)$/ inverted
  • Ignore tag updates (hideTags)
  • Ignore burst PR review comments in a short timespan, only showing the first x comments (commentBurstLimit)