diff --git a/plugins/scaffolder-backend/src/scaffolder/stages/prepare/github.ts b/plugins/scaffolder-backend/src/scaffolder/stages/prepare/github.ts index d2b29b5d0b..81ccdeb026 100644 --- a/plugins/scaffolder-backend/src/scaffolder/stages/prepare/github.ts +++ b/plugins/scaffolder-backend/src/scaffolder/stages/prepare/github.ts @@ -46,11 +46,13 @@ export class GithubPreparer implements PreparerBase { url, }); - const git = Git.fromAuth({ - username: 'x-access-token', - password: token, - logger, - }); + const git = token + ? Git.fromAuth({ + username: 'x-access-token', + password: token, + logger, + }) + : Git.fromAuth({ logger }); await git.clone({ url: parsedGitUrl.toString('https'),