Skip to content

Commit fa12407

Browse files
committed
FF-000 - Skip git info collection when no .git directory exists
1 parent 5b06f73 commit fa12407

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/cleanup.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,12 @@ async function collectAndPublishBuildInfoIfNeeded() {
105105
// We allow this step to fail, and we don't want to fail the entire build publish if they do.
106106
try {
107107
core.startGroup('Collect the Git information');
108-
await Utils.runCli(['rt', 'build-add-git'], { cwd: workingDirectory });
108+
const gitDir: string = require('path').join(workingDirectory, '.git');
109+
if (require('fs').existsSync(gitDir)) {
110+
await Utils.runCli(['rt', 'build-add-git'], { cwd: workingDirectory });
111+
} else {
112+
core.info('No .git directory found. Skipping Git information collection.');
113+
}
109114
} catch (error) {
110115
core.warning('Failed while attempting to collect Git information: ' + error);
111116
} finally {

0 commit comments

Comments
 (0)