From 0f57de08976cfd6ce3e9ad4cc240bd4aee35fcf2 Mon Sep 17 00:00:00 2001 From: Ashcon Partovi Date: Mon, 22 Apr 2024 17:50:27 -0700 Subject: [PATCH] Fix workflow --- .github/actions/cache/action.mjs | 10 +++++----- .github/actions/cache/dist/action.mjs | 8 +++++--- .github/actions/cache/dist/restore/action.mjs | 8 +++++--- .github/actions/cache/dist/save/action.mjs | 8 +++++--- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/actions/cache/action.mjs b/.github/actions/cache/action.mjs index ad2b537e50..0955ec8745 100644 --- a/.github/actions/cache/action.mjs +++ b/.github/actions/cache/action.mjs @@ -10,12 +10,14 @@ const restoreKeys = getMultilineInput("restore-keys"); const cacheDir = getInput("cache-dir") || join(tmpdir(), ".github", "cache"); export async function restoreCache() { - console.log("Restoring cache..."); - if (isGithubHosted()) { console.log("Using GitHub cache..."); try { - return await restoreGithubCache([path], key, restoreKeys); + const cacheKey = await restoreGithubCache([path], key, restoreKeys); + return { + cacheHit: !!cacheKey, + cacheKey: cacheKey ?? key, + }; } catch (error) { console.error("Failed to restore cache:", error); return null; @@ -69,8 +71,6 @@ export async function restoreCache() { } export async function saveCache() { - console.log("Saving cache..."); - if (isGithubHosted()) { console.log("Using GitHub cache..."); try { diff --git a/.github/actions/cache/dist/action.mjs b/.github/actions/cache/dist/action.mjs index 50ffc83c12..a004c35b20 100644 --- a/.github/actions/cache/dist/action.mjs +++ b/.github/actions/cache/dist/action.mjs @@ -69631,11 +69631,14 @@ import {cpSync, existsSync, mkdirSync, readdirSync} from "node:fs"; import {tmpdir} from "node:os"; import {join} from "node:path"; async function restoreCache() { - console.log("Restoring cache..."); if (isGithubHosted()) { console.log("Using GitHub cache..."); try { - return await cache.restoreCache([path], key, restoreKeys); + const cacheKey = await cache.restoreCache([path], key, restoreKeys); + return { + cacheHit: !!cacheKey, + cacheKey: cacheKey ?? key + }; } catch (error) { console.error("Failed to restore cache:", error); return null; @@ -69683,7 +69686,6 @@ async function restoreCache() { return null; } async function saveCache() { - console.log("Saving cache..."); if (isGithubHosted()) { console.log("Using GitHub cache..."); try { diff --git a/.github/actions/cache/dist/restore/action.mjs b/.github/actions/cache/dist/restore/action.mjs index fe1f7fdc5c..1a3c3b78b7 100644 --- a/.github/actions/cache/dist/restore/action.mjs +++ b/.github/actions/cache/dist/restore/action.mjs @@ -69631,11 +69631,14 @@ import {cpSync, existsSync, mkdirSync, readdirSync} from "node:fs"; import {tmpdir} from "node:os"; import {join} from "node:path"; async function restoreCache() { - console.log("Restoring cache..."); if (isGithubHosted()) { console.log("Using GitHub cache..."); try { - return await cache.restoreCache([path], key, restoreKeys); + const cacheKey = await cache.restoreCache([path], key, restoreKeys); + return { + cacheHit: !!cacheKey, + cacheKey: cacheKey ?? key + }; } catch (error) { console.error("Failed to restore cache:", error); return null; @@ -69683,7 +69686,6 @@ async function restoreCache() { return null; } async function saveCache() { - console.log("Saving cache..."); if (isGithubHosted()) { console.log("Using GitHub cache..."); try { diff --git a/.github/actions/cache/dist/save/action.mjs b/.github/actions/cache/dist/save/action.mjs index 2c18324edf..b45ae8b1bd 100644 --- a/.github/actions/cache/dist/save/action.mjs +++ b/.github/actions/cache/dist/save/action.mjs @@ -69631,11 +69631,14 @@ import {cpSync, existsSync, mkdirSync, readdirSync} from "node:fs"; import {tmpdir} from "node:os"; import {join} from "node:path"; async function restoreCache() { - console.log("Restoring cache..."); if (isGithubHosted()) { console.log("Using GitHub cache..."); try { - return await cache.restoreCache([path], key, restoreKeys); + const cacheKey = await cache.restoreCache([path], key, restoreKeys); + return { + cacheHit: !!cacheKey, + cacheKey: cacheKey ?? key + }; } catch (error) { console.error("Failed to restore cache:", error); return null; @@ -69683,7 +69686,6 @@ async function restoreCache() { return null; } async function saveCache() { - console.log("Saving cache..."); if (isGithubHosted()) { console.log("Using GitHub cache..."); try {