diff --git a/.changeset/good-foxes-fail.md b/.changeset/good-foxes-fail.md new file mode 100644 index 0000000000..6c0740b8d7 --- /dev/null +++ b/.changeset/good-foxes-fail.md @@ -0,0 +1,13 @@ +--- +'@backstage/plugin-catalog-backend-module-github': patch +--- + +Handle GitHub `organization`, `team` and `membership` events at the `GithubOrgEntityProvider` by subscribing to the respective topics + +Implements `EventSubscriber` to receive events for the topic `github.push`. + +On `organization`, `team` and `membership` events, the affected User or Group will be refreshed. +This includes adding new entities, refreshing existing ones, and removing obsolete ones. + +Please find more information at +https://backstage.io/docs/integrations/github/org#installation-with-events-support diff --git a/docs/integrations/github/org.md b/docs/integrations/github/org.md index ada6c31421..c2e67843e9 100644 --- a/docs/integrations/github/org.md +++ b/docs/integrations/github/org.md @@ -76,6 +76,7 @@ Set up your provider ```diff // packages/backend/src/plugins/catalogEventBasedProviders.ts ++import { CatalogClient } from '@backstage/catalog-client'; +import { GithubOrgEntityProvider } from '@backstage/plugin-catalog-backend-module-github'; import { EntityProvider } from '@backstage/plugin-catalog-node'; import { EventSubscriber } from '@backstage/plugin-events-node'; @@ -93,6 +94,8 @@ Set up your provider + id: 'production', + orgUrl: 'https://github.com/backstage', + logger: env.logger, ++ catalogApi: new CatalogClient({ discoveryApi: env.discovery }), ++ tokenManager: env.tokenManager, + schedule: env.scheduler.createScheduledTaskRunner({ + frequency: { minutes: 60 }, + timeout: { minutes: 15 }, @@ -103,10 +106,11 @@ Set up your provider } ``` -You can check the official docs to [configure your webhook](https://docs.github.com/en/developers/webhooks-and-events/webhooks/creating-webhooks) and to [secure your request](https://docs.github.com/en/developers/webhooks-and-events/webhooks/securing-your-webhooks). -The webhook will need to be configured to forward `organizatio` and `team` events. +**Attention:** +`catalogApi` and `tokenManager` are required at this variant compared to the one without events support. -**Please note that the event `team` with action `edited` and `removed_from_repository` will not be handled for this provider.** +You can check the official docs to [configure your webhook](https://docs.github.com/en/developers/webhooks-and-events/webhooks/creating-webhooks) and to [secure your request](https://docs.github.com/en/developers/webhooks-and-events/webhooks/securing-your-webhooks). +The webhook will need to be configured to forward `organization`,`team` and `membership` events. ## Configuration