From 67f61c6e6b67f38d41e4d63f5f59542c34dcdbd6 Mon Sep 17 00:00:00 2001 From: Dave Hadka Date: Tue, 29 Sep 2020 10:15:07 -0500 Subject: [PATCH] Add dist files --- dist/restore/index.js | 12 +++++++++++- dist/save/index.js | 11 ++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/dist/restore/index.js b/dist/restore/index.js index 00349f4..5df7480 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -5306,9 +5306,14 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getInputAsArray = exports.isValidEvent = exports.logWarning = exports.getCacheState = exports.setOutputAndState = exports.setCacheHitOutput = exports.setCacheState = exports.isExactKeyMatch = void 0; +exports.getInputAsArray = exports.isValidEvent = exports.logWarning = exports.getCacheState = exports.setOutputAndState = exports.setCacheHitOutput = exports.setCacheState = exports.isExactKeyMatch = exports.isGhes = void 0; const core = __importStar(__webpack_require__(470)); const constants_1 = __webpack_require__(694); +function isGhes() { + const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); + return ghUrl.hostname.toUpperCase() !== "GITHUB.COM"; +} +exports.isGhes = isGhes; function isExactKeyMatch(key, cacheKey) { return !!(cacheKey && cacheKey.localeCompare(key, undefined, { @@ -6836,6 +6841,11 @@ const utils = __importStar(__webpack_require__(443)); function run() { return __awaiter(this, void 0, void 0, function* () { try { + if (utils.isGhes()) { + core.info("Cache action is not supported on GHES"); + utils.setCacheHitOutput(false); + return; + } // Validate inputs, this can cause task failure if (!utils.isValidEvent()) { utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`); diff --git a/dist/save/index.js b/dist/save/index.js index f733e9a..85464df 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -5306,9 +5306,14 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getInputAsArray = exports.isValidEvent = exports.logWarning = exports.getCacheState = exports.setOutputAndState = exports.setCacheHitOutput = exports.setCacheState = exports.isExactKeyMatch = void 0; +exports.getInputAsArray = exports.isValidEvent = exports.logWarning = exports.getCacheState = exports.setOutputAndState = exports.setCacheHitOutput = exports.setCacheState = exports.isExactKeyMatch = exports.isGhes = void 0; const core = __importStar(__webpack_require__(470)); const constants_1 = __webpack_require__(694); +function isGhes() { + const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); + return ghUrl.hostname.toUpperCase() !== "GITHUB.COM"; +} +exports.isGhes = isGhes; function isExactKeyMatch(key, cacheKey) { return !!(cacheKey && cacheKey.localeCompare(key, undefined, { @@ -6593,6 +6598,10 @@ const utils = __importStar(__webpack_require__(443)); function run() { return __awaiter(this, void 0, void 0, function* () { try { + if (utils.isGhes()) { + core.info("Cache action is not supported on GHES"); + return; + } if (!utils.isValidEvent()) { utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`); return;