mirror of
https://code.forgejo.org/actions/checkout.git
synced 2025-04-22 01:22:02 +03:00
Add reset and clean for submodules
This commit is contained in:
parent
fd47087372
commit
ac7af06d80
3 changed files with 46 additions and 0 deletions
22
dist/index.js
vendored
22
dist/index.js
vendored
|
@ -7101,6 +7101,26 @@ class GitCommandManager {
|
|||
yield this.execGit(args);
|
||||
});
|
||||
}
|
||||
submoduleReset(recursive) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const args = ['submodule', 'foreach'];
|
||||
if (recursive) {
|
||||
args.push('--recursive');
|
||||
}
|
||||
args.push('git reset --hard');
|
||||
yield this.execGit(args);
|
||||
});
|
||||
}
|
||||
submoduleClean(recursive) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const args = ['submodule', 'foreach'];
|
||||
if (recursive) {
|
||||
args.push('--recursive');
|
||||
}
|
||||
args.push('git clean -ffdx');
|
||||
yield this.execGit(args);
|
||||
});
|
||||
}
|
||||
tagExists(pattern) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const output = yield this.execGit(['tag', '--list', pattern]);
|
||||
|
@ -7416,6 +7436,8 @@ function getSource(settings) {
|
|||
core.startGroup('Fetching submodules');
|
||||
yield git.submoduleSync(settings.nestedSubmodules);
|
||||
yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
|
||||
yield git.submoduleReset(settings.nestedSubmodules);
|
||||
yield git.submoduleClean(settings.nestedSubmodules);
|
||||
yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
|
||||
core.endGroup();
|
||||
// Persist credentials
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue