From e4a331f6ce13acd8f9a44b851bad357c70b11af3 Mon Sep 17 00:00:00 2001 From: Caleb Gosiak Date: Thu, 30 Sep 2021 16:13:35 -0500 Subject: [PATCH] v0.4.0 --- dist/restore/index.js | 9 +++++++-- dist/save/index.js | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dist/restore/index.js b/dist/restore/index.js index b7d67ee..1bf68d4 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -43299,6 +43299,7 @@ class CacheService { } saveCache(paths, key) { return __awaiter(this, void 0, void 0, function* () { + const cacheId = this.getCacheId(key); const compressionMethod = yield utils.getCompressionMethod(); const cachePaths = yield utils.resolvePaths(paths); core.debug("Cache Paths:"); @@ -43312,8 +43313,8 @@ class CacheService { yield tar_1.listTar(archivePath, compressionMethod); } core.info(`Archive Size: ${filesize_1.default(fs_1.default.statSync(archivePath).size)}`); - core.debug(`Saving Cache (ID: ${key})`); - yield this.uploadToS3(key, archivePath); + core.debug(`Saving Cache (ID: ${cacheId})`); + yield this.uploadToS3(cacheId, archivePath); } finally { // Try to delete the archive to save space @@ -43340,6 +43341,10 @@ class CacheService { .promise(); }); } + getCacheId(primaryKey) { + var _a; + return `${(_a = process.env["GITHUB_REPOSITORY"]) === null || _a === void 0 ? void 0 : _a.replace("/", "-").toLowerCase()}-${primaryKey}`; + } } exports.CacheService = CacheService; diff --git a/dist/save/index.js b/dist/save/index.js index 2a9b9f8..1e389d6 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -43299,6 +43299,7 @@ class CacheService { } saveCache(paths, key) { return __awaiter(this, void 0, void 0, function* () { + const cacheId = this.getCacheId(key); const compressionMethod = yield utils.getCompressionMethod(); const cachePaths = yield utils.resolvePaths(paths); core.debug("Cache Paths:"); @@ -43312,8 +43313,8 @@ class CacheService { yield tar_1.listTar(archivePath, compressionMethod); } core.info(`Archive Size: ${filesize_1.default(fs_1.default.statSync(archivePath).size)}`); - core.debug(`Saving Cache (ID: ${key})`); - yield this.uploadToS3(key, archivePath); + core.debug(`Saving Cache (ID: ${cacheId})`); + yield this.uploadToS3(cacheId, archivePath); } finally { // Try to delete the archive to save space @@ -43340,6 +43341,10 @@ class CacheService { .promise(); }); } + getCacheId(primaryKey) { + var _a; + return `${(_a = process.env["GITHUB_REPOSITORY"]) === null || _a === void 0 ? void 0 : _a.replace("/", "-").toLowerCase()}-${primaryKey}`; + } } exports.CacheService = CacheService;