mirror of
https://code.forgejo.org/actions/checkout.git
synced 2025-04-24 12:25:34 +00:00
Merge 7618b1f401
into 85e6279cec
This commit is contained in:
commit
9748052ab2
10 changed files with 84 additions and 8 deletions
14
dist/index.js
vendored
14
dist/index.js
vendored
|
@ -793,10 +793,10 @@ class GitCommandManager {
|
|||
yield this.execGit(args);
|
||||
});
|
||||
}
|
||||
submoduleUpdate(fetchDepth, recursive) {
|
||||
submoduleUpdate(fetchDepth, recursive, submoduleDirectories) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const args = ['-c', 'protocol.version=2'];
|
||||
args.push('submodule', 'update', '--init', '--force');
|
||||
args.push('submodule', 'update', '--init', '--force', ...submoduleDirectories);
|
||||
if (fetchDepth > 0) {
|
||||
args.push(`--depth=${fetchDepth}`);
|
||||
}
|
||||
|
@ -1340,7 +1340,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.fetchDepth, settings.nestedSubmodules, settings.submoduleDirectories);
|
||||
yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
|
||||
core.endGroup();
|
||||
// Persist credentials
|
||||
|
@ -1801,6 +1801,7 @@ function getInputs() {
|
|||
// Submodules
|
||||
result.submodules = false;
|
||||
result.nestedSubmodules = false;
|
||||
result.submoduleDirectories = [];
|
||||
const submodulesString = (core.getInput('submodules') || '').toUpperCase();
|
||||
if (submodulesString == 'RECURSIVE') {
|
||||
result.submodules = true;
|
||||
|
@ -1809,8 +1810,15 @@ function getInputs() {
|
|||
else if (submodulesString == 'TRUE') {
|
||||
result.submodules = true;
|
||||
}
|
||||
const submoduleDirectories = core.getMultilineInput('submodule-directories');
|
||||
if (submoduleDirectories.length > 0) {
|
||||
result.submoduleDirectories = submoduleDirectories;
|
||||
if (!result.submodules)
|
||||
result.submodules = true;
|
||||
}
|
||||
core.debug(`submodules = ${result.submodules}`);
|
||||
core.debug(`recursive submodules = ${result.nestedSubmodules}`);
|
||||
core.debug(`submodule directories = ${result.submoduleDirectories}`);
|
||||
// Auth token
|
||||
result.authToken = core.getInput('token', { required: true });
|
||||
// SSH
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue