File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments