scaffolder-backend: more efficient staging of files during publish

Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
Mike Lewis
2021-08-02 13:00:45 +01:00
parent 2f291dfd04
commit 1ce9b95711
2 changed files with 6 additions and 10 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend': patch
---
Use more efficient approach to staging files in git during scaffolder actions
@@ -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 = {