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:
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);
// [...]