mirror of
https://github.com/actions/cache.git
synced 2025-04-20 11:06:46 +00:00
adding wrapper to save-only and testcases
This commit is contained in:
parent
a92fb881ae
commit
0685539942
7 changed files with 61622 additions and 77 deletions
68
dist/save/index.js
vendored
68
dist/save/index.js
vendored
|
@ -47311,6 +47311,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const cache = __importStar(__webpack_require__(692));
|
||||
const core = __importStar(__webpack_require__(470));
|
||||
const constants_1 = __webpack_require__(196);
|
||||
const save_only_1 = __webpack_require__(973);
|
||||
const utils = __importStar(__webpack_require__(443));
|
||||
// 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
|
||||
|
@ -47328,7 +47329,9 @@ function run() {
|
|||
}
|
||||
const state = utils.getCacheState();
|
||||
// Inputs are re-evaluted before the post action, so we want the original key used for restore
|
||||
const primaryKey = core.getState(constants_1.State.CachePrimaryKey) || core.getInput(constants_1.Inputs.Key);
|
||||
const primaryKey = save_only_1.saveOnly === true
|
||||
? core.getInput(constants_1.Inputs.Key)
|
||||
: core.getState(constants_1.State.CachePrimaryKey);
|
||||
if (!primaryKey) {
|
||||
utils.logWarning(`Error retrieving key from state.`);
|
||||
return;
|
||||
|
@ -47352,7 +47355,6 @@ function run() {
|
|||
}
|
||||
});
|
||||
}
|
||||
run();
|
||||
exports.default = run;
|
||||
|
||||
|
||||
|
@ -55222,7 +55224,67 @@ exports.safeTrimTrailingSeparator = safeTrimTrailingSeparator;
|
|||
//# sourceMappingURL=internal-path-helper.js.map
|
||||
|
||||
/***/ }),
|
||||
/* 973 */,
|
||||
/* 973 */
|
||||
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (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;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.saveOnly = void 0;
|
||||
const core = __importStar(__webpack_require__(470));
|
||||
const constants_1 = __webpack_require__(196);
|
||||
const save_1 = __importDefault(__webpack_require__(681));
|
||||
const utils = __importStar(__webpack_require__(443));
|
||||
function runSaveAction() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!core.getInput(constants_1.Inputs.Key)) {
|
||||
utils.logWarning(`Error retrieving key from inputs.`);
|
||||
return;
|
||||
}
|
||||
exports.saveOnly = true;
|
||||
yield (0, save_1.default)();
|
||||
});
|
||||
}
|
||||
runSaveAction();
|
||||
exports.default = runSaveAction;
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 974 */,
|
||||
/* 975 */
|
||||
/***/ (function(__unusedmodule, exports) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue