mirror of
https://code.forgejo.org/actions/checkout.git
synced 2025-04-21 17:12:03 +03:00
Fix Self hosted runner issue wrt bad submodules - solution cleanup working space.
This commit is contained in:
parent
ac59398561
commit
7f14f1d824
3 changed files with 21 additions and 0 deletions
10
dist/index.js
vendored
10
dist/index.js
vendored
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue