Skip to main content

GitHub Webhooks

Handle GitHub Webhooks with Deno and Deno Deploy.

Installation

import { on, webhooks } from "https://deno.land/x/github_webhooks@0.1.0/mod.ts";

Example

A more complete example can be found in example/main.ts.

// main.ts
/// <reference lib="dom" />
/// <reference lib="dom.iterable" />
import { on, webhooks } from "https://deno.land/x/github_webhooks@0.1.0/mod.ts";

webhooks()(
  on("issue_comment", ({ issue, comment }, _context) => {
    console.info(
      `@${comment.user.login} commented on issue #${issue.number}: ${comment.body}`,
    );
  }),
);

Run the example:

$ deployctl run --libs=ns,fetchevent main.ts

Contributing

All contributions are very welcome!

If you find any bug or have a feature request, please open a new issue.

For code or documentation contributions, fork this repository, do your thing, and submit a Pull Request.

License

This project is released under the MIT License.