Skip to content

Commit

Permalink
Add deployment button
Browse files Browse the repository at this point in the history
  • Loading branch information
JRoy committed Jul 4, 2023
1 parent 231a350 commit c3e805a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 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/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
26 changes: 5 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# disgit
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)


## Supported Events
The following webhook events are supported as of now;
* [check_run](https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#check_run)
Expand All @@ -10,9 +15,7 @@ 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)
Expand All @@ -26,22 +29,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.

0 comments on commit c3e805a

Please sign in to comment.