From d478d703eb38c9033f5c0c9feea4db13319c16a7 Mon Sep 17 00:00:00 2001 From: Pavel Zwerschke Date: Thu, 23 May 2024 15:36:20 +0200 Subject: [PATCH] Fix saving cache taking too long --- dist/main.js | 2 +- src/main.ts | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/dist/main.js b/dist/main.js index 00a0df2..84c41fb 100644 --- a/dist/main.js +++ b/dist/main.js @@ -83131,7 +83131,7 @@ run().catch((error) => { (0, import_process.exit)(1); } throw error; -}); +}).then(() => (0, import_process.exit)(0)); /*! Bundled license information: undici/lib/fetch/body.js: diff --git a/src/main.ts b/src/main.ts index cbd9777..bd90b05 100644 --- a/src/main.ts +++ b/src/main.ts @@ -199,16 +199,18 @@ const run = async () => { await generateInfo(options) } -run().catch((error) => { - if (core.isDebug()) { +run() + .catch((error) => { + if (core.isDebug()) { + throw error + } + if (error instanceof Error) { + core.setFailed(error.message) + exit(1) + } else if (typeof error === 'string') { + core.setFailed(error) + exit(1) + } throw error - } - if (error instanceof Error) { - core.setFailed(error.message) - exit(1) - } else if (typeof error === 'string') { - core.setFailed(error) - exit(1) - } - throw error -}) + }) + .then(() => exit(0)) // workaround for https://github.com/actions/toolkit/issues/1578