diff --git a/dist/restore/index.js b/dist/restore/index.js index 1be2ad9..5d5bf18 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -6375,7 +6375,7 @@ function findObject(mc, bucket, keys, compressionMethod) { let objects = yield listObjects(mc, bucket, key); objects = objects.filter((o) => o.name.includes(fn)); if (objects.length < 1) { - break; + continue; } const sorted = objects.sort((a, b) => b.lastModified.getTime() - a.lastModified.getTime()); core.debug(`Found object ${JSON.stringify(sorted[0])}`); diff --git a/dist/save/index.js b/dist/save/index.js index 1f8a60a..920e29b 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -6375,7 +6375,7 @@ function findObject(mc, bucket, keys, compressionMethod) { let objects = yield listObjects(mc, bucket, key); objects = objects.filter((o) => o.name.includes(fn)); if (objects.length < 1) { - break; + continue; } const sorted = objects.sort((a, b) => b.lastModified.getTime() - a.lastModified.getTime()); core.debug(`Found object ${JSON.stringify(sorted[0])}`); diff --git a/src/utils.ts b/src/utils.ts index 5916f64..354a2d5 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -72,7 +72,7 @@ export async function findObject( let objects = await listObjects(mc, bucket, key); objects = objects.filter((o) => o.name.includes(fn)); if (objects.length < 1) { - break; + continue; } const sorted = objects.sort( (a, b) => b.lastModified.getTime() - a.lastModified.getTime()