3
0
Fork 0
mirror of https://code.forgejo.org/actions/checkout.git synced 2025-04-24 12:25:34 +00:00

Add fetch.parallel option

This commit is contained in:
Gonzalo Peci 2023-12-14 15:22:00 +01:00
parent edc3278d02
commit 9efed57e86
7 changed files with 36 additions and 2 deletions

7
dist/index.js vendored
View file

@ -1243,6 +1243,7 @@ function getSource(settings) {
}
// Fetch
core.startGroup('Fetching the repository');
yield git.config('fetch.parallel', settings.fetchParallel.toString());
const fetchOptions = {};
if (settings.filter) {
fetchOptions.filter = settings.filter;
@ -1753,6 +1754,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.fetchTags}`);
// Show fetch progress
result.showProgress =
(core.getInput('show-progress') || 'true').toUpperCase() === 'TRUE';