diff --git a/src/download-artifact.ts b/src/download-artifact.ts index aedfe12..17ddc77 100644 --- a/src/download-artifact.ts +++ b/src/download-artifact.ts @@ -21,6 +21,7 @@ async function run(): Promise { path: core.getInput(Inputs.Path, {required: false}), token: core.getInput(Inputs.GitHubToken, {required: false}), repository: core.getInput(Inputs.Repository, {required: false}), + maxAttempts: core.getInput(constants_1.Inputs.MaxAttempts, { required: false }), runID: parseInt(core.getInput(Inputs.RunID, {required: false})), pattern: core.getInput(Inputs.Pattern, {required: false}), mergeMultiple: core.getBooleanInput(Inputs.MergeMultiple, {required: false}) @@ -55,6 +56,14 @@ async function run(): Promise { } } + if (inputs.maxAttempts) { + core.info(`Max attempts for retrying download: ${inputs.maxAttempts}`); + options.findBy["maxAttempts"] = inputs.maxAttempts; + } + else { + throw new Error(`Invalid retryCount: '${inputs.maxAttempts}'. Must be greater than 0`); + } + let artifacts: Artifact[] = [] if (isSingleArtifactDownload) {