mirror of
https://code.forgejo.org/actions/checkout.git
synced 2025-04-27 06:19:54 +02:00
Add fetch.parallel option
This commit is contained in:
parent
edc3278d02
commit
9efed57e86
7 changed files with 36 additions and 2 deletions
|
@ -153,6 +153,7 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
|
|||
|
||||
// Fetch
|
||||
core.startGroup('Fetching the repository')
|
||||
await git.config('fetch.parallel', settings.fetchParallel.toString())
|
||||
const fetchOptions: {
|
||||
filter?: string
|
||||
fetchDepth?: number
|
||||
|
|
|
@ -54,6 +54,11 @@ export interface IGitSourceSettings {
|
|||
*/
|
||||
fetchTags: boolean
|
||||
|
||||
/**
|
||||
* Indicates the maximal number of fetch operations to be run in parallel at a time
|
||||
*/
|
||||
fetchParallel: number
|
||||
|
||||
/**
|
||||
* Indicates whether to use the --progress option when fetching
|
||||
*/
|
||||
|
|
|
@ -113,6 +113,15 @@ export async function getInputs(): Promise<IGitSourceSettings> {
|
|||
(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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue