From 4f70af085ce10a475a0f725a368e6097eafb74a5 Mon Sep 17 00:00:00 2001 From: laughedelic Date: Mon, 8 Apr 2024 00:56:01 +0200 Subject: [PATCH] fix dangling post-save --- src/save.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/save.ts b/src/save.ts index 6c3edd4..b5cfc7a 100644 --- a/src/save.ts +++ b/src/save.ts @@ -63,6 +63,11 @@ async function doRun(): Promise { const msg = err instanceof Error ? err.message : String(err) core.info(`[warning] Caught ${msg}, ignoring it`) } + + // Explicit termination to make sure we don't hang with some dangling promises. + // Same as https://github.com/actions/cache/blob/0c45773b623bea8c8e75f6c82b208c3cf94ea4f9/src/saveImpl.ts#L116-L123 + core.info('All caches saved') + process.exit(0) } doRun()