diff --git a/.changeset/famous-cobras-suffer.md b/.changeset/famous-cobras-suffer.md new file mode 100644 index 0000000000..d09948f876 --- /dev/null +++ b/.changeset/famous-cobras-suffer.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-github': patch +--- + +Added the githubCredentialsProvider property to the GithubLocationAnalyzerOptions to be able to override the GithubCredentialsProvider. diff --git a/plugins/catalog-backend-module-github/api-report.md b/plugins/catalog-backend-module-github/api-report.md index 7a85d685a3..8ccfdb09ee 100644 --- a/plugins/catalog-backend-module-github/api-report.md +++ b/plugins/catalog-backend-module-github/api-report.md @@ -128,6 +128,7 @@ export type GithubLocationAnalyzerOptions = { config: Config; discovery: PluginEndpointDiscovery; tokenManager: TokenManager; + githubCredentialsProvider?: GithubCredentialsProvider; }; // @public diff --git a/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts b/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts index a740fd7706..139a92ee83 100644 --- a/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts +++ b/plugins/catalog-backend-module-github/src/analyzers/GithubLocationAnalyzer.ts @@ -39,6 +39,7 @@ export type GithubLocationAnalyzerOptions = { config: Config; discovery: PluginEndpointDiscovery; tokenManager: TokenManager; + githubCredentialsProvider?: GithubCredentialsProvider; }; /** @public */ @@ -52,6 +53,7 @@ export class GithubLocationAnalyzer implements ScmLocationAnalyzer { this.catalogClient = new CatalogClient({ discoveryApi: options.discovery }); this.integrations = ScmIntegrations.fromConfig(options.config); this.githubCredentialsProvider = + options.githubCredentialsProvider || DefaultGithubCredentialsProvider.fromIntegrations(this.integrations); this.tokenManager = options.tokenManager; }