From d6e2920f9ede9b85fdfdf6306385215f407ac595 Mon Sep 17 00:00:00 2001 From: Danila Danko Date: Sun, 10 Mar 2024 13:13:42 +0300 Subject: [PATCH] refactor: no need for a workaround for https://github.com/actions/toolkit/pull/1378#issuecomment-1478388929 since we use the latest @cache-nix-action/cache which is a mod of @actions/cache which has this bug fixed https://github.com/actions/cache/pull/1302 --- src/utils/action.ts | 3 +-- src/utils/purge.ts | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/utils/action.ts b/src/utils/action.ts index beb7e5cd..ee227218 100644 --- a/src/utils/action.ts +++ b/src/utils/action.ts @@ -70,8 +70,7 @@ export async function restoreCache({ lookupOnly: boolean; }) { return await cache.restoreCache( - // https://github.com/actions/toolkit/pull/1378#issuecomment-1478388929 - inputs.paths.slice(), + inputs.paths, primaryKey, restoreKeys, { lookupOnly }, diff --git a/src/utils/purge.ts b/src/utils/purge.ts index 7a2b3b0d..125239be 100644 --- a/src/utils/purge.ts +++ b/src/utils/purge.ts @@ -149,8 +149,6 @@ export async function purgeCachesByTime({ time: number; prefixes: string[]; }): Promise { - // TODO https://github.com/actions/toolkit/pull/1378#issuecomment-1478388929 - for (const doUseLastAccessedTime of [true, false]) { if ( (doUseLastAccessedTime @@ -160,7 +158,7 @@ export async function purgeCachesByTime({ await purgeByTime({ primaryKey, doUseLastAccessedTime, - prefixes: prefixes.slice(), + prefixes, time }); }