Adam O'Grady

Watched Webhooks

For a recent project I realised I would love to be able to set up webhooks for repositories I watch (and don’t administer). So to overcome that I’ve created a Node.js script, WatchedWebhook.

You pass it a GitHub username as a command line argument and it polls the “public received events” feed (including your watched repositories). Any new events that match the event type and repository of rules you specify (in rules.js) cause it to fire off a POST request with the event data to a webhook specified by rule.

I still plan on building it out a bit more but would love to hear any suggestions, feature requests or bugs.

Potential Use Cases

Dependency Monitoring

Building a larger project that depends on a bunch of other stuff? Watch the repositories you depend on and when your webhook receives a ping (from this script) it can engage a testing/Continuous Integration suite that pits the new build of the dependency against automated tests and shoots you a notification if the build passes so you can upgrade the dependency version you use.

Content Updating

If there’s a community-sourced project such as vulndb/data which receives regular updates, the webhook request can trigger a download of the new/changed content.