diff --git a/dist/index.js b/dist/index.js index b57f1659..b20ac2a1 100644 Binary files a/dist/index.js and b/dist/index.js differ diff --git a/dist/index.js.map b/dist/index.js.map index 404daf08..d76d1e49 100644 Binary files a/dist/index.js.map and b/dist/index.js.map differ diff --git a/src/model/cloud-runner/remote-client/index.ts b/src/model/cloud-runner/remote-client/index.ts index d24066fc..38db71c3 100644 --- a/src/model/cloud-runner/remote-client/index.ts +++ b/src/model/cloud-runner/remote-client/index.ts @@ -224,6 +224,23 @@ export class RemoteClient { if (!CloudRunner.buildParameters.skipLfs) { try { RemoteClientLogger.log(`Attempting to pull LFS files with GIT_PRIVATE_TOKEN...`); + + // Configure git to use GIT_PRIVATE_TOKEN + const gitPrivateToken = process.env.GIT_PRIVATE_TOKEN; + if (!gitPrivateToken) { + throw new Error('GIT_PRIVATE_TOKEN is not available'); + } + + await CloudRunnerSystem.Run( + `git config --global --replace-all url."https://token:${gitPrivateToken}@github.com/".insteadOf ssh://git@github.com/`, + ); + await CloudRunnerSystem.Run( + `git config --global --add url."https://token:${gitPrivateToken}@github.com/".insteadOf git@github.com`, + ); + await CloudRunnerSystem.Run( + `git config --global --add url."https://token:${gitPrivateToken}@github.com/".insteadOf "https://github.com/"`, + ); + await CloudRunnerSystem.Run(`git lfs pull`); RemoteClientLogger.log(`Successfully pulled LFS files with GIT_PRIVATE_TOKEN`); assert(fs.existsSync(CloudRunnerFolders.lfsFolderAbsolute));