Files
backstage/plugins/events-backend-module-github
Patrick Jungermann b3a4edb885 feat(events/github): add GithubEventRouter
Add an event router for GitHub
which handles events from the topic `github`
and re-publishes events under their more specific topic
based on the `x-github-event` metadata
like e.g., `github.push`.

Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
2022-11-12 01:14:29 +01:00
..

events-backend-module-github

Welcome to the events-backend-module-github backend plugin!

This plugin is a module for the events-backend backend plugin and extends it with an GithubEventRouter.

The event router will subscribe to the topic github and route the events to more concrete topics based on the value of the provided x-github-event metadata field.

Examples:

x-github-event topic
pull_request github.pull_request
push github.push
repository github.repository

Please find all possible webhook event types at the official documentation.

Installation

Install the events-backend plugin.

Install this module:

# From your Backstage root directory
yarn add --cwd packages/backend @backstage/plugin-events-backend-module-github

Add the event router to the EventsBackend:

+const githubEventRouter = new GithubEventRouter();

 EventsBackend
+  .addPublishers(githubEventRouter)
+  .addSubscribers(githubEventRouter);
// [...]