Set default cache input to false for self-hosted runners

This commit is contained in:
Sergey Dolin 2023-08-17 18:16:38 +02:00
parent 93397bea11
commit 8b0dfa3b5d
6 changed files with 102 additions and 19 deletions

View file

@ -58495,6 +58495,7 @@ const cache = __importStar(__nccwpck_require__(7799));
const fs_1 = __importDefault(__nccwpck_require__(7147));
const constants_1 = __nccwpck_require__(9042);
const cache_utils_1 = __nccwpck_require__(1678);
const utils_1 = __nccwpck_require__(1314);
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
// throw an uncaught exception. Instead of failing this action, just warn.
@ -58521,10 +58522,8 @@ function run() {
}
exports.run = run;
const cachePackages = () => __awaiter(void 0, void 0, void 0, function* () {
const cacheInput = core.getBooleanInput('cache');
if (!cacheInput) {
if (!utils_1.getCacheInput())
return;
}
const packageManager = 'default';
const state = core.getState(constants_1.State.CacheMatchedKey);
const primaryKey = core.getState(constants_1.State.CachePrimaryKey);
@ -58693,6 +58692,52 @@ exports.supportedPackageManagers = {
};
/***/ }),
/***/ 1314:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getCacheInput = exports.isSelfHosted = exports.StableReleaseAlias = void 0;
const core = __importStar(__nccwpck_require__(2186));
var StableReleaseAlias;
(function (StableReleaseAlias) {
StableReleaseAlias["Stable"] = "stable";
StableReleaseAlias["OldStable"] = "oldstable";
})(StableReleaseAlias = exports.StableReleaseAlias || (exports.StableReleaseAlias = {}));
const isSelfHosted = () => process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' &&
process.env['AGENT_ISSELFHOSTED'] === '1';
exports.isSelfHosted = isSelfHosted;
const getCacheInput = () => {
// for self-hosted environment turn off cache by default
if (exports.isSelfHosted() && core.getInput('cache') === '')
return false;
return core.getBooleanInput('cache');
};
exports.getCacheInput = getCacheInput;
/***/ }),
/***/ 2877: