Discord webhooks for public GitHub repositories without needing admin access to them.
You will need NodeJS v12 or later, and the octokit
and
discord-webhook-node
NPM packages.
npm install octokit
npm install discord-webhook-node
All configuration goes in config.json
. It looks something like this:
{
"repoOwner": "TerryCavanagh",
"repoName": "VVVVVV",
"webhookUrl": "DISCORD_WEBHOOK_URL_HERE",
"delaySecs": 10,
"ignoreEvents": ["WatchEvent", "ForkEvent"],
"githubAuth": "GITHUB_TOKEN_HERE"
}
This will act as a webhook for the TerryCavanagh/VVVVVV repo while ignoring forks and watches (actually stars).
githubAuth
is not strictly required, but is strongly recommended, due
to the fact that GitHub severely limits the amount of requests that
unauthenticated users can make. Most GitHub authentication tokens are
suitable here, such as a personal access
token.
Run node index.js
. It will run in a loop. Ctrl-C to stop it when you
don't want it anymore.
DIY Webhook is licensed under AGPLv3-only. See
LICENSE.md
for details.