Only process fetch-jobs argument if submodules are enabled

This commit is contained in:
Frits Talbot 2022-12-31 11:36:08 +01:00
parent cd648cffcf
commit d46e61f9c4
2 changed files with 19 additions and 13 deletions

View file

@ -89,13 +89,6 @@ export async function getInputs(): Promise<IGitSourceSettings> {
}
core.debug(`fetch depth = ${result.fetchDepth}`)
// Fetch jobs
result.fetchJobs = Math.floor(Number(core.getInput('fetch-jobs') || '-1'))
if (isNaN(result.fetchJobs) || result.fetchJobs < -1) {
result.fetchJobs = -1
}
core.debug(`fetch jobs = ${result.fetchJobs}`)
// LFS
result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE'
core.debug(`lfs = ${result.lfs}`)
@ -113,6 +106,16 @@ export async function getInputs(): Promise<IGitSourceSettings> {
core.debug(`submodules = ${result.submodules}`)
core.debug(`recursive submodules = ${result.nestedSubmodules}`)
// Fetch jobs during submodule update
result.fetchJobs = -1
if (result.submodules) {
result.fetchJobs = Math.floor(Number(core.getInput('fetch-jobs') || '-1'))
if (isNaN(result.fetchJobs) || result.fetchJobs < -1) {
result.fetchJobs = -1
}
core.debug(`fetch jobs = ${result.fetchJobs}`)
}
// Auth token
result.authToken = core.getInput('token', {required: true})