Make access optional

This commit is contained in:
Tim Jacomb
2020-09-16 14:09:54 +01:00
parent 80b56edec3
commit 7806decbc4
2 changed files with 3 additions and 3 deletions
@@ -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,
@@ -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,