diff --git a/plugins/scaffolder-backend/api-report.md b/plugins/scaffolder-backend/api-report.md index aea6689183..3947d64049 100644 --- a/plugins/scaffolder-backend/api-report.md +++ b/plugins/scaffolder-backend/api-report.md @@ -382,13 +382,15 @@ export function fetchContents({ // Warning: (ae-missing-release-tag) "OctokitProvider" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // -// @public +// @public @deprecated export class OctokitProvider { constructor( integrations: ScmIntegrationRegistry, githubCredentialsProvider?: GithubCredentialsProvider, ); // Warning: (ae-forgotten-export) The symbol "OctokitIntegration" needs to be exported by the entry point index.d.ts + // + // @deprecated getOctokit( repoUrl: string, options?: { diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/github/OctokitProvider.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/github/OctokitProvider.ts index d481e42c9f..92b8554e37 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/github/OctokitProvider.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/github/OctokitProvider.ts @@ -33,7 +33,8 @@ export type OctokitIntegration = { * OctokitProvider provides Octokit client based on ScmIntegrationsRegistry configuration. * OctokitProvider supports GitHub credentials caching out of the box. * - * @deprecated use the internal {@link getOctokitOptions} function instead + * @deprecated we are no longer providing a way from the scaffolder to generate octokit instances. + * Implement your own if you're using this method from an external package, or suse the internal `getOctokitOptions` function instead */ export class OctokitProvider { private readonly integrations: ScmIntegrationRegistry; @@ -54,7 +55,8 @@ export class OctokitProvider { * * @param repoUrl - Repository URL * - * @deprecated use the internal {@link getOctokitOptions} function instead + * @deprecated we are no longer providing a way from the scaffolder to generate octokit instances. + * Implement your own if you're using this method from an external package, or suse the internal `getOctokitOptions` function instead */ async getOctokit( repoUrl: string, diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/github/githubWebhook.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/github/githubWebhook.ts index dc52bd5fb4..ac75dd9d82 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/github/githubWebhook.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/github/githubWebhook.ts @@ -19,7 +19,7 @@ import { } from '@backstage/integration'; import { createTemplateAction } from '../../createTemplateAction'; import { emitterEventNames } from '@octokit/webhooks'; -import { assertError } from '@backstage/errors'; +import { assertError, InputError } from '@backstage/errors'; import { Octokit } from 'octokit'; import { getOctokitOptions } from './helpers'; import { parseRepoUrl } from '../publish/util'; @@ -29,11 +29,8 @@ export function createGithubWebhookAction(options: { defaultWebhookSecret?: string; githubCredentialsProvider?: GithubCredentialsProvider; }) { - const { - integrations, - defaultWebhookSecret, - githubCredentialsProvider, - } = options; + const { integrations, defaultWebhookSecret, githubCredentialsProvider } = + options; const eventNames = emitterEventNames.filter(event => !event.includes('.')); @@ -139,7 +136,7 @@ export function createGithubWebhookAction(options: { ); if (!owner) { - throw new InputError('Invalid repository owner'); + throw new InputError('Invalid repository owner provided in repoUrl'); } try {