Skip to content

tei187/github-discord-webhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Github-Discord Webhook

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.

Features

  • Seamless integration between GitHub and Discord
  • Customizable notifications for different GitHub events
  • Easy setup and configuration

Setup

  1. Register a new webhook in your Discord server. You can find more information on how to do this here.
  2. 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
            'repo' => [ 'username/repository-name' ],
        ]
    ];
  3. Register a new webhook in your GitHub repository. You can find more information about registering webhooks here.
    1. Enter your payload URL. If you have this package hosted i.e. under http://example.com/webhook, then the payload URL should be http://example.com/webhook/sample-webhook.
    2. Select "application/json" as the content type.
    3. Pick you secret and make sure to copy it somewhere, alternatively update the 'secret' key in config\webhooks.php.
    4. Alternatively pick which events you want to listen to.
  4. Believe it or not, that's it.

Usage

Once set up, you'll receive notifications in your Discord server for events such as:

  • Push events
  • Pull requests
  • Issues
  • Comments
  • And more! in the future

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

PHP GitHub-Discord webhook manager

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages