From 90f45856e1897627a4a9a7d3703114934774da01 Mon Sep 17 00:00:00 2001 From: Bruno Borges Date: Thu, 9 Jul 2026 21:16:37 -0400 Subject: [PATCH] Fix broken try/catch in saveAdditionalCache and rebuild dist The autofix commits dropped the `} catch (error) {` line in saveAdditionalCache, leaving a `try` block without a catch and a dangling `error` reference, which broke compilation and Prettier. Restore the catch clause, reformat, and regenerate the dist bundles. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- dist/cleanup/index.js | 9 +++------ dist/setup/index.js | 9 +++------ src/cache.ts | 5 ++++- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/dist/cleanup/index.js b/dist/cleanup/index.js index d6e09fe4..e2e65877 100644 --- a/dist/cleanup/index.js +++ b/dist/cleanup/index.js @@ -99825,10 +99825,7 @@ async function restoreAdditionalCache(additionalCache) { const matchedKey = await cache.restoreCache(additionalCache.path, primaryKey); if (matchedKey) { core.saveState(additionalCacheMatchedKeyState(additionalCache.name), matchedKey); - core.info(`Cache restored from key: ${matchedKey}`); - } - else { - core.info(`${additionalCache.name} cache is not found`); + core.info(`${additionalCache.name} cache restored from key: ${matchedKey}`); } } /** @@ -99896,10 +99893,10 @@ async function saveAdditionalCache(packageManager, additionalCache) { try { const cacheId = await cache_saveCache(additionalCache.path, primaryKey); if (cacheId === -1) { - core_debug(`Cache was not saved for the key: ${primaryKey}`); + core_debug(`${additionalCache.name} cache was not saved for the key: ${primaryKey}`); return; } - info(`Cache saved with the key: ${primaryKey}`); + info(`${additionalCache.name} cache saved with the key: ${primaryKey}`); } catch (error) { const err = error; diff --git a/dist/setup/index.js b/dist/setup/index.js index b88156ce..d0bd8b8b 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -131047,10 +131047,7 @@ async function restoreAdditionalCache(additionalCache) { const matchedKey = await restoreCache(additionalCache.path, primaryKey); if (matchedKey) { saveState(additionalCacheMatchedKeyState(additionalCache.name), matchedKey); - info(`Cache restored from key: ${matchedKey}`); - } - else { - info(`${additionalCache.name} cache is not found`); + info(`${additionalCache.name} cache restored from key: ${matchedKey}`); } } /** @@ -131118,10 +131115,10 @@ async function saveAdditionalCache(packageManager, additionalCache) { try { const cacheId = await cache.saveCache(additionalCache.path, primaryKey); if (cacheId === -1) { - core.debug(`Cache was not saved for the key: ${primaryKey}`); + core.debug(`${additionalCache.name} cache was not saved for the key: ${primaryKey}`); return; } - core.info(`Cache saved with the key: ${primaryKey}`); + core.info(`${additionalCache.name} cache saved with the key: ${primaryKey}`); } catch (error) { const err = error; diff --git a/src/cache.ts b/src/cache.ts index 21e5e2af..9783aaee 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -327,7 +327,10 @@ async function saveAdditionalCache( ); return; } - core.info(`${additionalCache.name} cache saved with the key: ${primaryKey}`); + core.info( + `${additionalCache.name} cache saved with the key: ${primaryKey}` + ); + } catch (error) { const err = error as Error; if (err.name === cache.ReserveCacheError.name) {