1
0
Fork 0
mirror of https://code.forgejo.org/actions/download-artifact synced 2025-06-08 04:58:20 +02:00
This commit is contained in:
dhawalseth 2025-03-19 21:52:18 +01:00 committed by GitHub
commit 2aab2e3d67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 1 deletions

View file

@ -11,6 +11,10 @@ inputs:
pattern: pattern:
description: 'A glob pattern matching the artifacts that should be downloaded. Ignored if name is specified.' description: 'A glob pattern matching the artifacts that should be downloaded. Ignored if name is specified.'
required: false required: false
max-attempts:
description: 'Maximum number of attempts while retrying download.'
required: false
default: '5'
merge-multiple: merge-multiple:
description: 'When multiple artifacts are matched, this changes the behavior of the destination directories. description: 'When multiple artifacts are matched, this changes the behavior of the destination directories.
If true, the downloaded artifacts will be in the same directory specified by path. If true, the downloaded artifacts will be in the same directory specified by path.

View file

@ -5,7 +5,8 @@ export enum Inputs {
Repository = 'repository', Repository = 'repository',
RunID = 'run-id', RunID = 'run-id',
Pattern = 'pattern', Pattern = 'pattern',
MergeMultiple = 'merge-multiple' MergeMultiple = 'merge-multiple',
MaxAttempts = 'max-attempts'
} }
export enum Outputs { export enum Outputs {

View file

@ -21,6 +21,7 @@ export 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 @@ export 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) {