diff --git a/plugins/scaffolder-backend/src/scaffolder/stages/publish/github.ts b/plugins/scaffolder-backend/src/scaffolder/stages/publish/github.ts index 09cb720ebe..b50d5730fb 100644 --- a/plugins/scaffolder-backend/src/scaffolder/stages/publish/github.ts +++ b/plugins/scaffolder-backend/src/scaffolder/stages/publish/github.ts @@ -55,7 +55,7 @@ export class GithubPublisher implements PublisherBase { const { data } = await repoCreationPromise; - if (access.match(new RegExp(`${owner}/.+`))) { + if (access && access.match(new RegExp(`${owner}/.+`))) { const [, team] = access.split('/'); await this.client.teams.addOrUpdateRepoPermissionsInOrg({ org: owner, @@ -66,7 +66,7 @@ export class GithubPublisher implements PublisherBase { }); } else { // no need to add access if it's the person who own's the personal account - if (access !== owner) { + if (access && access !== owner) { await this.client.repos.addCollaborator({ owner, repo: name, diff --git a/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx b/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx index 60f74e4cbe..0f8ceb7a4e 100644 --- a/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx +++ b/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx @@ -54,7 +54,7 @@ const useTemplate = ( const OWNER_REPO_SCHEMA = { $schema: 'http://json-schema.org/draft-07/schema#' as const, - required: ['storePath', 'owner', 'access'], + required: ['storePath', 'owner'], properties: { owner: { type: 'string' as const,