From 6a5070d392db3e8c776724674737cab37c07263d Mon Sep 17 00:00:00 2001 From: Manas Jayanth <3097018+ManasJayanth@users.noreply.github.com> Date: Sat, 11 May 2024 11:49:16 +0530 Subject: [PATCH] Use a separate cache key for sources cache --- action.yml | 3 +++ dist/index.js | 3 ++- index.ts | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index e91c01a..3b8af3e 100644 --- a/action.yml +++ b/action.yml @@ -4,6 +4,9 @@ inputs: cache-key: description: A cache key for esy.json/esy.lock. required: true + source-cache-key: + description: A cache key for retrieving esy sources cache. + required: true working-directory: description: Working directory for esy required: false diff --git a/dist/index.js b/dist/index.js index 128bb2b..d2394f7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -87091,6 +87091,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume const esyPrefix = _actions_core__WEBPACK_IMPORTED_MODULE_1__.getInput("esy-prefix"); const cacheKey = _actions_core__WEBPACK_IMPORTED_MODULE_1__.getInput("cache-key"); +const sourceCacheKey = _actions_core__WEBPACK_IMPORTED_MODULE_1__.getInput("source-cache-key"); const manifestKey = _actions_core__WEBPACK_IMPORTED_MODULE_1__.getInput("manifest"); function run(name, command, args) { return __awaiter(this, void 0, void 0, function* () { @@ -87112,7 +87113,7 @@ function main() { const platform = os__WEBPACK_IMPORTED_MODULE_4__.platform(); const arch = os__WEBPACK_IMPORTED_MODULE_4__.arch(); const installPath = ["~/.esy/source"]; - const installKey = `source-${platform}-${arch}-${cacheKey}`; + const installKey = `source-${platform}-${arch}-${sourceCacheKey}`; _actions_core__WEBPACK_IMPORTED_MODULE_1__.startGroup("Restoring install cache"); const installCacheKey = yield _actions_cache__WEBPACK_IMPORTED_MODULE_0__.restoreCache(installPath, installKey, []); if (installCacheKey) { diff --git a/index.ts b/index.ts index 4048c3b..25392fc 100644 --- a/index.ts +++ b/index.ts @@ -8,6 +8,7 @@ import * as util from "util"; const esyPrefix = core.getInput("esy-prefix"); const cacheKey = core.getInput("cache-key"); +const sourceCacheKey = core.getInput("source-cache-key"); const manifestKey = core.getInput("manifest"); async function run(name: string, command: string, args: string[]) { @@ -30,7 +31,7 @@ async function main() { const platform = os.platform(); const arch = os.arch(); const installPath = ["~/.esy/source"]; - const installKey = `source-${platform}-${arch}-${cacheKey}`; + const installKey = `source-${platform}-${arch}-${sourceCacheKey}`; core.startGroup("Restoring install cache"); const installCacheKey = await cache.restoreCache( installPath,