Update download-artifact.ts

This commit is contained in:
dhawalseth 2024-02-07 14:21:51 -08:00 committed by GitHub
parent b8fe923df2
commit 8371d5fae1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,6 +21,7 @@ async function run(): Promise<void> {
path: core.getInput(Inputs.Path, {required: false}), path: core.getInput(Inputs.Path, {required: false}),
token: core.getInput(Inputs.GitHubToken, {required: false}), token: core.getInput(Inputs.GitHubToken, {required: false}),
repository: core.getInput(Inputs.Repository, {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})), runID: parseInt(core.getInput(Inputs.RunID, {required: false})),
pattern: core.getInput(Inputs.Pattern, {required: false}), pattern: core.getInput(Inputs.Pattern, {required: false}),
mergeMultiple: core.getBooleanInput(Inputs.MergeMultiple, {required: false}) mergeMultiple: core.getBooleanInput(Inputs.MergeMultiple, {required: false})
@ -55,6 +56,14 @@ async function run(): Promise<void> {
} }
} }
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[] = [] let artifacts: Artifact[] = []
if (isSingleArtifactDownload) { if (isSingleArtifactDownload) {