This project implements a webhook integration between GitHub and Discord. It allows to handle multiple webhooks for different repositories and Discord channels, ran from the same script.
- Seamless integration between GitHub and Discord
- Customizable notifications for different GitHub events
- Easy setup and configuration
- Register a new webhook in your Discord server. You can find more information on how to do this here.
- Configure your webhook in the
config\webhooks.php
file.<?php return [ // webhook name that will be used in payload URL in GitHub 'sample-webhook' => [ // Discord webhook URL 'url' => 'https://discord.com/api/webhooks/(...)', // GitHub secret key 'secret' => 'your-github-secret-key', // Array of repositories to filter through // May be left empty to listen to all repositories 'repos' => [ 'username/repository-name' ], ] ];
- Set up rest of the config files (or if you want to run default, just remove the
.example
extensions). - Register a new webhook in your GitHub repository. You can find more information about registering webhooks here.
- Enter your payload URL. If you have this package hosted i.e. under
http://example.com/webhook
, then the payload URL should behttp://example.com/webhook/sample-webhook
. - Select
"application/json"
as the content type. - Pick you secret and make sure to copy it somewhere, alternatively update the 'secret' key in
config\webhooks.php
. - Alternatively pick which events you want to listen to.
- Enter your payload URL. If you have this package hosted i.e. under
- Believe it or not, that's it.
All configuration options are located in config
directory. There you can set up classes for handlinng messages, payloads and webhooks. Also, there's a configuration file setting allowed events and actions.
Once set up, you'll receive notifications in your Discord server for events concerning:
- Commits
- Tags
- Releases
- Branches
- Forks
Future plans include:
- Pull requests
- Issues
- Comments
- And more!
This project is licensed under the MIT License - see the LICENSE file for details.