dotCore-off / github-webhook-relay

A simple GitHub webhook to Discord relay.
7 stars 2 forks source link
discord github php webhook

Github Webhooks Relay

Relay sent webhooks for repository push events to your Discord server.

Features

Installation

Without Composer

  1. Download webhook-relay.zip file from latest release
  2. Unzip it and upload folder content to your webhost

With Composer

  1. Download relay.php and config.php files and upload them to your webhost
  2. Install Livaco Discord Webhook library using composer install command

  1. Edit config.php to your likings

    For $dc_webhookurl: Edit channel > Integrations > Webhooks > Create or select one > Copy Webhook URL
    For $dc_secret: You can set a secret, which will be used to verify the webhook's authenticity. (It needs to be the same as in your repository settings and should be secure.)

  2. In your repository settings, add a Webhook with the following details

    Payload URL: URL to your relay.php file (https://example.com/relay.php)
    Content Type: application/x-www-form-urlencoded
    Secret: Here you can enter a secret, which will be used to verify the webhook's authenticity. (It needs to be the same as in your config.php and should be secure.)

  3. Upon webhook creation, you should now receive a message upon every push to the repository

    image

Customization

Too simple? Fear not, Livaco got your back!
You can customize your embed in relay.php file at line 81.

List of available methods to customize your embed
A complicated example by Livaco
image

Credits