From 24aef17bbf89f5b5e0b9792461a8d49e99b693c7 Mon Sep 17 00:00:00 2001
From: Ryan Ghadimi <114221941+GhadimiR@users.noreply.github.com>
Date: Wed, 12 Mar 2025 14:02:51 +0000
Subject: [PATCH] Refactor loop

---
 src/download-artifact.ts | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/download-artifact.ts b/src/download-artifact.ts
index 71852f3..68471c0 100644
--- a/src/download-artifact.ts
+++ b/src/download-artifact.ts
@@ -124,15 +124,13 @@ async function run(): Promise<void> {
 
   const chunkedPromises = chunk(downloadPromises, PARALLEL_DOWNLOADS)
   for (const chunk of chunkedPromises) {
-    await Promise.all(chunk)
-  }
-
-  for (const dlPromise of downloadPromises) {
-    const outcome = await dlPromise
-    if (outcome.digestMismatch) {
-      core.warning(
-        `Artifact digest validation failed. Please verify the integrity of the artifact.`
-      )
+    const result = await Promise.all(chunk)
+    for (const outcome of result) {
+      if (outcome.digestMismatch) {
+        core.warning(
+          `Artifact digest validation failed. Please verify the integrity of the artifact.`
+        )
+      }
     }
   }