mirror of
https://code.forgejo.org/actions/checkout.git
synced 2025-04-21 09:10:16 +03:00
Added separate parameter for submodules fetch depth
This commit is contained in:
parent
5a4ac9002d
commit
25e07a18d3
6 changed files with 38 additions and 2 deletions
8
dist/index.js
vendored
8
dist/index.js
vendored
|
@ -6255,7 +6255,7 @@ function getSource(settings) {
|
|||
// Checkout submodules
|
||||
core.startGroup('Fetching submodules');
|
||||
yield git.submoduleSync(settings.nestedSubmodules);
|
||||
yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
|
||||
yield git.submoduleUpdate(settings.submodulesFetchDepth, settings.nestedSubmodules);
|
||||
yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
|
||||
core.endGroup();
|
||||
// Persist credentials
|
||||
|
@ -14572,6 +14572,12 @@ function getInputs() {
|
|||
result.fetchDepth = 0;
|
||||
}
|
||||
core.debug(`fetch depth = ${result.fetchDepth}`);
|
||||
// Submodules fetch depth
|
||||
result.submodulesFetchDepth = Math.floor(Number(core.getInput('submodules-fetch-depth') || '-1'));
|
||||
if (isNaN(result.submodulesFetchDepth) || result.submodulesFetchDepth < 0) {
|
||||
result.submodulesFetchDepth = result.fetchDepth;
|
||||
}
|
||||
core.debug(`submodules fetch depth = ${result.submodulesFetchDepth}`);
|
||||
// LFS
|
||||
result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
|
||||
core.debug(`lfs = ${result.lfs}`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue