@@ -795,17 +795,32 @@ class GitCommandManager {
795
795
yield this.execGit(args);
796
796
});
797
797
}
798
- submoduleUpdate(fetchDepth, recursive) {
798
+ submoduleUpdate(fetchDepth, recursive, submodules ) {
799
799
return __awaiter(this, void 0, void 0, function* () {
800
- const args = ['-c', 'protocol.version=2'];
801
- args.push('submodule', 'update', '--init', '--force');
802
- if (fetchDepth > 0) {
803
- args.push(`--depth=${fetchDepth}`);
800
+ if (Array.isArray(submodules)) {
801
+ for (const submodule of submodules) {
802
+ const args = ['-c', 'protocol.version=2'];
803
+ args.push('submodule', 'update', '--init', '--force', submodule);
804
+ if (fetchDepth > 0) {
805
+ args.push(`--depth=${fetchDepth}`);
806
+ }
807
+ if (recursive) {
808
+ args.push('--recursive');
809
+ }
810
+ yield this.execGit(args);
811
+ }
804
812
}
805
- if (recursive) {
806
- args.push('--recursive');
813
+ else {
814
+ const args = ['-c', 'protocol.version=2'];
815
+ args.push('submodule', 'update', '--init', '--force');
816
+ if (fetchDepth > 0) {
817
+ args.push(`--depth=${fetchDepth}`);
818
+ }
819
+ if (recursive) {
820
+ args.push('--recursive');
821
+ }
822
+ yield this.execGit(args);
807
823
}
808
- yield this.execGit(args);
809
824
});
810
825
}
811
826
submoduleStatus() {
@@ -1342,7 +1357,7 @@ function getSource(settings) {
1342
1357
// Checkout submodules
1343
1358
core.startGroup('Fetching submodules');
1344
1359
yield git.submoduleSync(settings.nestedSubmodules);
1345
- yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
1360
+ yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules, settings.submodules );
1346
1361
yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
1347
1362
core.endGroup();
1348
1363
// Persist credentials
0 commit comments