mirror of
https://github.com/actions/checkout.git
synced 2026-07-18 20:20:08 +08:00
Apply filter options to submodule update
Fixes: https://github.com/actions/checkout/issues/1714
This commit is contained in:
parent
e8d4307400
commit
057e2c1f09
4 changed files with 90 additions and 5 deletions
7
dist/index.js
vendored
7
dist/index.js
vendored
|
|
@ -35872,7 +35872,7 @@ class GitCommandManager {
|
|||
}
|
||||
await this.execGit(args);
|
||||
}
|
||||
async submoduleUpdate(fetchDepth, recursive) {
|
||||
async submoduleUpdate(fetchDepth, recursive, filter) {
|
||||
const args = ['-c', 'protocol.version=2'];
|
||||
args.push('submodule', 'update', '--init', '--force');
|
||||
if (fetchDepth > 0) {
|
||||
|
|
@ -35881,6 +35881,9 @@ class GitCommandManager {
|
|||
if (recursive) {
|
||||
args.push('--recursive');
|
||||
}
|
||||
if (filter) {
|
||||
args.push(`--filter=${filter}`);
|
||||
}
|
||||
await this.execGit(args);
|
||||
}
|
||||
async submoduleStatus() {
|
||||
|
|
@ -41888,7 +41891,7 @@ async function getSource(settings) {
|
|||
// Checkout submodules
|
||||
startGroup('Fetching submodules');
|
||||
await git.submoduleSync(settings.nestedSubmodules);
|
||||
await git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
|
||||
await git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules, fetchOptions.filter);
|
||||
await git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
|
||||
endGroup();
|
||||
// Persist credentials
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue