3
0
Fork 0
mirror of https://code.forgejo.org/actions/checkout.git synced 2025-04-24 20:35:33 +00:00
This commit is contained in:
Gonzalo Peci 2024-03-15 15:42:40 +09:00 committed by GitHub
commit ff5874f76b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 219 additions and 103 deletions

17
dist/index.js vendored
View file

@ -1255,6 +1255,7 @@ function getSource(settings) {
}
// Fetch
core.startGroup('Fetching the repository');
yield git.config('fetch.parallel', settings.fetchParallel.toString(), true);
const fetchOptions = {};
if (settings.filter) {
fetchOptions.filter = settings.filter;
@ -1323,6 +1324,7 @@ function getSource(settings) {
core.endGroup();
// Checkout submodules
core.startGroup('Fetching submodules');
yield git.config('submodule.fetchJobs', settings.submodulesFetchJobs.toString(), true);
yield git.submoduleSync(settings.nestedSubmodules);
yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
@ -1771,6 +1773,12 @@ function getInputs() {
result.fetchTags =
(core.getInput('fetch-tags') || 'false').toUpperCase() === 'TRUE';
core.debug(`fetch tags = ${result.fetchTags}`);
// Fetch tags
result.fetchParallel = Math.floor(Number(core.getInput('fetch-parallel') || '1'));
if (isNaN(result.fetchParallel) || result.fetchParallel < 0) {
result.fetchParallel = 0;
}
core.debug(`fetch parallel = ${result.fetchParallel}`);
// Show fetch progress
result.showProgress =
(core.getInput('show-progress') || 'true').toUpperCase() === 'TRUE';
@ -1789,10 +1797,17 @@ function getInputs() {
else if (submodulesString == 'TRUE') {
result.submodules = true;
}
result.submodulesFetchJobs = Math.floor(Number(core.getInput('submodules-fetch-jobs') || '1'));
if (isNaN(result.submodulesFetchJobs) || result.submodulesFetchJobs < 0) {
result.submodulesFetchJobs = 0;
}
core.debug(`submodules = ${result.submodules}`);
core.debug(`recursive submodules = ${result.nestedSubmodules}`);
core.debug(`submodules submodules-fetch-jobs = ${result.submodulesFetchJobs}`);
// Auth token
result.authToken = core.getInput('token', { required: true });
result.authToken = core.getInput('token', {
required: true
});
// SSH
result.sshKey = core.getInput('ssh-key');
result.sshKnownHosts = core.getInput('ssh-known-hosts');