diff --git a/action.yml b/action.yml index 7f58660e..17c3441c 100644 --- a/action.yml +++ b/action.yml @@ -261,7 +261,10 @@ inputs: default: 'false' required: false description: 'Skip the activation/deactivation of Unity. This assumes Unity is already activated.' - + cloneDepth: + default: '50' + required: false + description: '[CloudRunner] Specifies the depth of the clone for the repository' outputs: volume: description: 'The Persistent Volume (PV) where the build artifacts have been stored by Kubernetes' diff --git a/dist/index.js b/dist/index.js index d4f3ada3..ca8a3f26 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 fbd793e1..6425497a 100644 Binary files a/dist/index.js.map and b/dist/index.js.map differ diff --git a/src/model/build-parameters.ts b/src/model/build-parameters.ts index 8cf60d59..7d72569f 100644 --- a/src/model/build-parameters.ts +++ b/src/model/build-parameters.ts @@ -67,6 +67,7 @@ class BuildParameters { public pullInputList!: string[]; public inputPullCommand!: string; public cacheKey!: string; + public cloneDepth!: number; public postBuildContainerHooks!: string; public preBuildContainerHooks!: string; @@ -205,6 +206,7 @@ class BuildParameters { pullInputList: CloudRunnerOptions.pullInputList, kubeStorageClass: CloudRunnerOptions.kubeStorageClass, cacheKey: CloudRunnerOptions.cacheKey, + maxRetainedWorkspaces: Number.parseInt(CloudRunnerOptions.maxRetainedWorkspaces), useLargePackages: CloudRunnerOptions.useLargePackages, useCompressionStrategy: CloudRunnerOptions.useCompressionStrategy, @@ -218,6 +220,7 @@ class BuildParameters { cacheUnityInstallationOnMac: Input.cacheUnityInstallationOnMac, unityHubVersionOnMac: Input.unityHubVersionOnMac, dockerWorkspacePath: Input.dockerWorkspacePath, + cloneDepth: Number.parseInt(CloudRunnerOptions.cloneDepth), }; } diff --git a/src/model/cloud-runner/options/cloud-runner-options.ts b/src/model/cloud-runner/options/cloud-runner-options.ts index 814d104c..dc09da5b 100644 --- a/src/model/cloud-runner/options/cloud-runner-options.ts +++ b/src/model/cloud-runner/options/cloud-runner-options.ts @@ -139,6 +139,10 @@ class CloudRunnerOptions { return CloudRunnerOptions.getInput('customJob') || ''; } + static get cloneDepth(): string { + return CloudRunnerOptions.getInput('cloneDepth') || `50`; + } + // ### ### ### // Custom commands from files parameters // ### ### ### diff --git a/src/model/cloud-runner/remote-client/index.ts b/src/model/cloud-runner/remote-client/index.ts index fc899769..4a5477d5 100644 --- a/src/model/cloud-runner/remote-client/index.ts +++ b/src/model/cloud-runner/remote-client/index.ts @@ -184,7 +184,9 @@ export class RemoteClient { await CloudRunnerSystem.Run(`git config --global filter.lfs.process "git-lfs filter-process --skip"`); try { await CloudRunnerSystem.Run( - `git clone ${CloudRunnerFolders.targetBuildRepoUrl} ${path.basename(CloudRunnerFolders.repoPathAbsolute)}`, + `git clone --depth ${CloudRunnerOptions.cloneDepth} ${CloudRunnerFolders.targetBuildRepoUrl} ${path.basename( + CloudRunnerFolders.repoPathAbsolute, + )}`, ); } catch (error: any) { throw error;