Fix Self hosted runner issue wrt bad submodules - solution cleanup working space.

This commit is contained in:
SKi 2023-03-01 19:23:12 -08:00
parent ac59398561
commit 7f14f1d824
No known key found for this signature in database
3 changed files with 21 additions and 0 deletions

10
dist/index.js vendored
View file

@ -7683,6 +7683,12 @@ class GitCommandManager {
yield this.execGit(args);
});
}
submoduleStatus() {
return __awaiter(this, void 0, void 0, function* () {
const output = yield this.execGit(['submodule', 'status'], true);
return output.exitCode === 0;
});
}
tagExists(pattern) {
return __awaiter(this, void 0, void 0, function* () {
const output = yield this.execGit(['tag', '--list', pattern]);
@ -9436,6 +9442,10 @@ function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref
}
}
core.endGroup();
// Check for submodules and delete any existing files if submodules are present
if (!(yield git.submoduleStatus())) {
remove = true;
}
// Clean
if (clean) {
core.startGroup('Cleaning the repository');