Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
NotMyFault committed Sep 1, 2023
2 parents ae0a34f + 0f69b74 commit 8cf039f
Show file tree
Hide file tree
Showing 10 changed files with 1,927 additions and 171 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Deploy Worker
on:
push:
repository_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- name: Build & Deploy Worker
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea/
.idea/
node_modules/
29 changes: 7 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# disgit
A cloudflare worker script which provides better github->discord webhooks than the built in discord webhook executor.
A Cloudflare Worker which provides better GitHub->Discord webhook integration than the built-in Discord webhook executor.

You can use this Cloudflare worker by following the steps after clicking the button below

[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/JRoy/disgit)


This repository is based on [JRoy/disgit](https://github.com/JRoy/disgit), deploying to IntellectualSites' CF workers via GitHub actions.

Expand All @@ -12,14 +17,13 @@ The following webhook events are supported as of now;
* [deployment](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#deployment)
* [deployment_status](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#deployment_status)
* [discussion](https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#discussion)
* Event is invite-only (at time of writing) and needs to be manually selected in webhook settings
* [discussion_comment](https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#discussion_comment)
* Event is invite-only (at time of writing) and needs to be manually selected in webhook settings
* [fork](https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#fork)
* [gollum](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#gollum) (wiki)
* [issue_comment](https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#issue_comment)
* This event also sends pull request comments...*sigh*
* [issues](https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#issues)
* [package](https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#package)
* [ping](https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#ping)
* [pull_request](https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#pull_request)
* [pull_request_review](https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review)
Expand All @@ -28,22 +32,3 @@ The following webhook events are supported as of now;
* [release](https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#release)
* [star](https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#star)
* ...feel free to contribute more that suit your needs!

## Installation
1. Go to your cloudflare worker dashboard by clicking [here](https://dash.cloudflare.com/?to=/:account/workers)
and create a new worker.
1. Copy all the code from [disgit.js](https://github.com/JRoy/disgit/blob/master/disgit.js) and paste it into
the script window of your worker.
1. Click `Save and Deploy` and confirm your deployment.
1. Create a new webhook in your GitHub repository/organization settings.
1. Paste your worker's url into the `Payload URL` field and append `(webhook id)/(webhook token)` to the end.
* For example if you had the worker url `https://my-worker.test.workers.dev` and the discord webhook url
`https://discord.com/api/webhooks/840438712203557422/8H3D57RQzftJmhw9VfEaLFLABjItuDScjU-c_nYKffb1hTlktLapwd`,
the payload url you should have in the GitHub webhook form is
`https://my-worker.test.workers.dev/840438712203557422/8H3D57RQzftJmhw9VfEaLFLABjItuDScjU-c_nYKffb1hTlktLapwd`.
1. Set the `Content type` to `application/json`
1. You can configure the events to whichever you would like to receive. *Remember that some events require you to
explicitly pick them in "`Let me select individual events`" and will not send with the "`Send my everything`"
option.*
1. Click `Add webhook`.
1. That's it, you're all setup, and your webhooks should start coming in.
Loading

0 comments on commit 8cf039f

Please sign in to comment.