/GitHub_Webhook

GitHub Webhooks for pull requests

Primary LanguagePython

GitHub_Webhook

Gui Interface

Screen Shot 2021-11-19 at 15 48 06

Response From http://localhost:3000/

Screen Shot 2021-11-19 at 14 25 56

Ngrok script

Screen Shot 2021-11-18 at 18 45 41

First, we need to install a program that exposes our localhost to the internet. If you already use another program, expose port 3000 and skip to the second step.

  1. Signup to ngrok, download and install.

  2. Expose port 3000:

    ./ngrok http 3000
  3. Copy the url from the second Forwarding line, should look like https://xxxxxxxx.ngrok.io.

  4. Goto Settings/Webhooks in your repository, and fill in the form:

    • Payload URL: https://xxxxxxxx.ngrok.io

    • Content type: application/json

    • Secret: The GITHUB_SECRET defined in your environment, you could generate a random string using:

      node -p "crypto.randomBytes(20).toString('hex')"

Installation:

  1. clone repo
  2. cd repo/client
    • npm install
    • npm start
  3. cd repo/server install pipenv
    • pipenv shell
    • pipenv lock -r
    • python manage.py makemigrations
    • python manage.py migrate
    • python manage.py runserver 0.0.0.0:3000 Enjoy!