CurryEleison / webhooks-testing

Trying out GitHub webhooks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

webhooks-testing

Trying out GitHub webhooks. Steps to reproduce are at https://docs.github.com/en/developers/webhooks-and-events/webhooks/creating-webhooks .

To run it:

  1. Do ngrok http 4567 at the command line
  2. Note the url it gives you use that as payload to create a webhook in GitHub
    • Url will change on every run, so webhook needs to be updated in every session
  3. Use application/json as content type
  4. Generate some random characters with e.g. hexdump -n 16 -e '4/4 "%08X" 1 "\n"' /dev/urandom
  5. Set that as the secret in the webhook and export it as SECRET_TOKEN in your shell
  6. Install dependencies with pipenv install
  7. Run with pipenv run python server.py
  8. Do stuff in GitHub (push, create issues, comment etc) and watch it scroll over the screen in your terminal
    • Easy way to generate events is to re-deliver old deliveries

About

Trying out GitHub webhooks

License:Apache License 2.0


Languages

Language:Python 100.0%