From e381232758f330fdb7b3af2735f73f5d08332f42 Mon Sep 17 00:00:00 2001 From: "Nolan, Tavi" Date: Thu, 11 Apr 2024 11:19:51 +0100 Subject: [PATCH] Update githubRepoCreate.ts Signed-off-by: Nolan, Tavi --- .../src/actions/githubRepoCreate.ts | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/plugins/scaffolder-backend-module-github/src/actions/githubRepoCreate.ts b/plugins/scaffolder-backend-module-github/src/actions/githubRepoCreate.ts index 80edb219df..52bf9be9c0 100644 --- a/plugins/scaffolder-backend-module-github/src/actions/githubRepoCreate.ts +++ b/plugins/scaffolder-backend-module-github/src/actions/githubRepoCreate.ts @@ -14,24 +14,22 @@ * limitations under the License. */ -import * as inputProps from './inputProperties'; -import * as outputProps from './outputProperties'; - +import { InputError } from '@backstage/errors'; import { GithubCredentialsProvider, ScmIntegrationRegistry, } from '@backstage/integration'; -import { - createGithubRepoWithCollaboratorsAndTopics, - getOctokitOptions, -} from './helpers'; +import { Octokit } from 'octokit'; import { createTemplateAction, parseRepoUrl, } from '@backstage/plugin-scaffolder-node'; - -import { InputError } from '@backstage/errors'; -import { Octokit } from 'octokit'; +import { + createGithubRepoWithCollaboratorsAndTopics, + getOctokitOptions, +} from './helpers'; +import * as inputProps from './inputProperties'; +import * as outputProps from './outputProperties'; import { examples } from './githubRepoCreate.examples'; /** @@ -190,13 +188,6 @@ export function createGithubRepoCreateAction(options: { throw new InputError('Invalid repository owner provided in repoUrl'); } - if (ctx.isDryRun) { - ctx.logger.info(`Performing dry run of creating repository`); - ctx.output('remoteUrl', 'www.example.com'); - ctx.logger.info(`Dry run complete`); - return; - } - const newRepo = await createGithubRepoWithCollaboratorsAndTopics( client, repo,