mirror of
https://code.forgejo.org/actions/checkout.git
synced 2025-04-21 17:12:03 +03:00
Merge 37332a5498
into add3486cc3
This commit is contained in:
commit
777fadabba
5 changed files with 58 additions and 0 deletions
25
dist/index.js
vendored
25
dist/index.js
vendored
|
@ -7109,6 +7109,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]);
|
||||
|
@ -7420,6 +7440,11 @@ function getSource(settings) {
|
|||
core.startGroup('Setting up auth for fetching submodules');
|
||||
yield authHelper.configureGlobalAuth();
|
||||
core.endGroup();
|
||||
// Clean existing submodules
|
||||
if (settings.clean) {
|
||||
yield git.submoduleReset(settings.nestedSubmodules);
|
||||
yield git.submoduleClean(settings.nestedSubmodules);
|
||||
}
|
||||
// Checkout submodules
|
||||
core.startGroup('Fetching submodules');
|
||||
yield git.submoduleSync(settings.nestedSubmodules);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue