diff --git a/.changeset/old-bulldogs-fry.md b/.changeset/old-bulldogs-fry.md index c6bbce6c53..9c8eef67ad 100644 --- a/.changeset/old-bulldogs-fry.md +++ b/.changeset/old-bulldogs-fry.md @@ -2,7 +2,7 @@ '@backstage/plugin-catalog-backend-module-github': patch --- -Handle Github `push` events at the `GithubEntityProvider` by subscribing to the topic `github.push.` +Handle GitHub `push` events at the `GithubEntityProvider` by subscribing to the topic `github.push.` Implements `EventSubscriber` to receive events for the topic `github.push`. @@ -10,7 +10,5 @@ On `github.push`, the affected repository will be refreshed. This includes adding new Location entities, refreshing existing ones, and removing obsolete ones. -**Installation and Migration** - Please find more information at https://backstage.io/docs/integrations/github/discovery#installation-with-events-support diff --git a/docs/integrations/github/discovery.md b/docs/integrations/github/discovery.md index 02310052a1..2184ae7679 100644 --- a/docs/integrations/github/discovery.md +++ b/docs/integrations/github/discovery.md @@ -69,7 +69,6 @@ Set up your provider ```diff // packages/backend/src/plugins/catalogEventBasedProviders.ts -+import { CatalogClient } from '@backstage/catalog-client'; +import { GithubEntityProvider } from '@backstage/plugin-catalog-backend-module-github'; import { EntityProvider } from '@backstage/plugin-catalog-node'; import { EventSubscriber } from '@backstage/plugin-events-node'; @@ -98,6 +97,8 @@ 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() + ## Configuration To use the discovery provider, you'll need a GitHub integration diff --git a/plugins/catalog-backend-module-github/src/providers/GithubEntityProvider.ts b/plugins/catalog-backend-module-github/src/providers/GithubEntityProvider.ts index 2d3e1cd1af..4aaba06e3e 100644 --- a/plugins/catalog-backend-module-github/src/providers/GithubEntityProvider.ts +++ b/plugins/catalog-backend-module-github/src/providers/GithubEntityProvider.ts @@ -53,7 +53,7 @@ type Repository = { url: string; isArchived: boolean; repositoryTopics: string[]; - defaultBranchRef: string | null; + defaultBranchRef?: string; isCatalogInfoFilePresent: boolean; }; @@ -213,7 +213,7 @@ export class GithubEntityProvider implements EntityProvider, EventSubscriber { return { url: r.url, name: r.name, - defaultBranchRef: r.defaultBranchRef?.name || null, + defaultBranchRef: r.defaultBranchRef?.name, repositoryTopics: r.repositoryTopics.nodes.map(t => t.topic.name), isArchived: r.isArchived, isCatalogInfoFilePresent: