1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-04-23 21:09:53 +02:00

Adds input for upload chunk size

This commit is contained in:
Dave Hadka 2020-10-02 09:59:55 -05:00
parent d606e039ae
commit a6f1f4b32e
10 changed files with 84 additions and 11 deletions

15
dist/save/index.js vendored
View file

@ -31296,7 +31296,7 @@ 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 = exports.isGhes = void 0;
exports.getInputAsInt = 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() {
@ -31353,6 +31353,14 @@ function getInputAsArray(name, options) {
.filter(x => x !== "");
}
exports.getInputAsArray = getInputAsArray;
function getInputAsInt(name, options) {
const value = Number(core.getInput(name, options));
if (Number.isNaN(value) || value < 0) {
return undefined;
}
return value;
}
exports.getInputAsInt = getInputAsInt;
/***/ }),
@ -38353,7 +38361,9 @@ function run() {
required: true
});
try {
yield cache.saveCache(cachePaths, primaryKey);
yield cache.saveCache(cachePaths, primaryKey, {
uploadChunkSize: utils.getInputAsInt(constants_1.Inputs.UploadChunkSize)
});
}
catch (error) {
if (error.name === cache.ValidationError.name) {
@ -38574,6 +38584,7 @@ var Inputs;
Inputs["Key"] = "key";
Inputs["Path"] = "path";
Inputs["RestoreKeys"] = "restore-keys";
Inputs["UploadChunkSize"] = "upload-chunk-size";
})(Inputs = exports.Inputs || (exports.Inputs = {}));
var Outputs;
(function (Outputs) {