Always replace /head from branch
parent
755df48342
commit
3ca6426707
|
|
@ -305,7 +305,7 @@ class BuildParameters {
|
||||||
preBuildSteps: input_1.default.preBuildSteps,
|
preBuildSteps: input_1.default.preBuildSteps,
|
||||||
customJob: input_1.default.customJob,
|
customJob: input_1.default.customJob,
|
||||||
runNumber: input_1.default.runNumber,
|
runNumber: input_1.default.runNumber,
|
||||||
branch: input_1.default.branch || (yield git_repo_1.GitRepoReader.GetBranch()),
|
branch: input_1.default.branch.replace('/head', '') || (yield git_repo_1.GitRepoReader.GetBranch()),
|
||||||
cloudRunnerBranch: input_1.default.cloudRunnerBranch.split('/').reverse()[0],
|
cloudRunnerBranch: input_1.default.cloudRunnerBranch.split('/').reverse()[0],
|
||||||
cloudRunnerIntegrationTests: input_1.default.cloudRunnerTests,
|
cloudRunnerIntegrationTests: input_1.default.cloudRunnerTests,
|
||||||
githubRepo: input_1.default.githubRepo || (yield git_repo_1.GitRepoReader.GetRemote()) || 'game-ci/unity-builder',
|
githubRepo: input_1.default.githubRepo || (yield git_repo_1.GitRepoReader.GetRemote()) || 'game-ci/unity-builder',
|
||||||
|
|
@ -3846,7 +3846,11 @@ class GitRepoReader {
|
||||||
static GetBranch() {
|
static GetBranch() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
console_1.assert(fs_1.default.existsSync(`.git`));
|
console_1.assert(fs_1.default.existsSync(`.git`));
|
||||||
return (yield system_1.default.run(`git branch`, [], {}, false)).split('*')[1].split(`\n`)[0].replace(/ /g, ``);
|
return (yield system_1.default.run(`git branch`, [], {}, false))
|
||||||
|
.split('*')[1]
|
||||||
|
.split(`\n`)[0]
|
||||||
|
.replace(/ /g, ``)
|
||||||
|
.replace('/head', '');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -131,7 +131,7 @@ class BuildParameters {
|
||||||
preBuildSteps: Input.preBuildSteps,
|
preBuildSteps: Input.preBuildSteps,
|
||||||
customJob: Input.customJob,
|
customJob: Input.customJob,
|
||||||
runNumber: Input.runNumber,
|
runNumber: Input.runNumber,
|
||||||
branch: Input.branch || (await GitRepoReader.GetBranch()),
|
branch: Input.branch.replace('/head', '') || (await GitRepoReader.GetBranch()),
|
||||||
cloudRunnerBranch: Input.cloudRunnerBranch.split('/').reverse()[0],
|
cloudRunnerBranch: Input.cloudRunnerBranch.split('/').reverse()[0],
|
||||||
cloudRunnerIntegrationTests: Input.cloudRunnerTests,
|
cloudRunnerIntegrationTests: Input.cloudRunnerTests,
|
||||||
githubRepo: Input.githubRepo || (await GitRepoReader.GetRemote()) || 'game-ci/unity-builder',
|
githubRepo: Input.githubRepo || (await GitRepoReader.GetRemote()) || 'game-ci/unity-builder',
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,10 @@ export class GitRepoReader {
|
||||||
|
|
||||||
public static async GetBranch() {
|
public static async GetBranch() {
|
||||||
assert(fs.existsSync(`.git`));
|
assert(fs.existsSync(`.git`));
|
||||||
return (await System.run(`git branch`, [], {}, false)).split('*')[1].split(`\n`)[0].replace(/ /g, ``);
|
return (await System.run(`git branch`, [], {}, false))
|
||||||
|
.split('*')[1]
|
||||||
|
.split(`\n`)[0]
|
||||||
|
.replace(/ /g, ``)
|
||||||
|
.replace('/head', '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue