diff --git a/.changeset/large-bears-wash.md b/.changeset/large-bears-wash.md new file mode 100644 index 0000000000..3255714dd6 --- /dev/null +++ b/.changeset/large-bears-wash.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +--- + +Use more efficient approach to staging files in git during scaffolder actions diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/helpers.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/helpers.ts index 7a10046fd0..002640092c 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/helpers.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/helpers.ts @@ -16,7 +16,6 @@ import { spawn } from 'child_process'; import { PassThrough, Writable } from 'stream'; -import globby from 'globby'; import { Logger } from 'winston'; import { Git } from '@backstage/backend-common'; import { Octokit } from '@octokit/rest'; @@ -84,15 +83,7 @@ export async function initRepoAndPush({ defaultBranch, }); - const paths = await globby(['./**', './**/.*', '!.git'], { - cwd: dir, - gitignore: true, - dot: true, - }); - - for (const filepath of paths) { - await git.add({ dir, filepath }); - } + await git.add({ dir, filepath: '.' }); // use provided info if possible, otherwise use fallbacks const authorInfo = {