Nasal Pathway Melodrama


    1.0.1 • Public • Published


    A Hubot script to that makes it easy to consume Github Webhooks.


    From your hubot folder: npm install --save hubot-github-webhook-listener

    Then, in your external-scripts.json file, add: "hubot-github-webhook-listener" to the list.

    Create a new webhook for your myuser/myrepo repository at: Set the webhook url to: <HUBOT_URL>:<PORT>/hubot/github-repo-listener

    For example, if your hubot lives at, then you will set the webhook URL to:


    On every incoming webhook message, a hubot event is emitted as follows

    eventBody =
      eventType   : req.headers["x-github-event"]
      signature   : req.headers["X-Hub-Signature"]
      deliveryId  : req.headers["X-Github-Delivery"]
      payload     : req.body
      query       : querystring.parse(url.parse(req.url).query)
    robot.emit "github-repo-event", eventBody

    For details on these fields, see the Github Webhook documentation.

    Securing Your Webhooks

    To ensure non-github sources cannot send messages to your hubot, set an environment variable named GITHUB_WEBHOOK_SECRET to your Github hooks secret.

    Consuming the event

    You can consume it like so from one of your scripts:

    @robot.on "github-repo-event", (repo_event) =>
      githubPayload = repo_event.payload
        when "issue_comment"

    NOTE: This script does not emit anything in chat. It is just a background task that makes consuming Github webhooks easier for other scripts.

    For another example, see our Hubot-Github adapter that gives you a hubot in your Github issue comments.


    I was using hubot-github-repo-event-notifier, but I needed something more generic to power our hubot-github adapter. So, I gutted it, and this script was born.

    Local Testing

    For easy local testing, I highly recommend ngrok:

    1. Install ngrok
    2. run ngrok: ngrok 8080. It will show you a public URL like: Forwarding ->
    3. Put that URL in as your Github webhook:
    4. Install the hubot-github adapter npm install --save hubot-github-adapter
    5. Run hubot locally: HUBOT_GITHUB_TOKEN=some_long_guid GITHUB_WEBHOOK_SECRET=some_secret bin/hubot -a github-adapter --name Hubot
    6. Fire off a github event by interacting with your repo. Comment on an issue or a PR for example.
    7. Navigate to There you can see all webhooks posted to your local machine, and can replay them as many times as you wish.


    Copyright ©, LLC. (Github: YNAB)


    Taylor Brown, aka Taytay


    MIT License; see LICENSE for further details.


    npm i @viddsee/hubot-github-webhook-listener

    DownloadsWeekly Downloads






    Last publish


    • viddsee