Add validation for post step (#3)

* work on fixing cache post step

* fix tests
This commit is contained in:
Dmitry Shibanov 2021-08-18 05:52:37 +03:00 committed by GitHub
parent 5f3f74c689
commit 53f73ba16b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 4 deletions

11
dist/cleanup/index.js vendored
View file

@ -6185,6 +6185,7 @@ exports.run = void 0;
const core = __importStar(__webpack_require__(470));
const gpg = __importStar(__webpack_require__(884));
const constants = __importStar(__webpack_require__(694));
const util_1 = __webpack_require__(322);
const cache_1 = __webpack_require__(913);
function removePrivateKeyFromKeychain() {
return __awaiter(this, void 0, void 0, function* () {
@ -6206,8 +6207,9 @@ function removePrivateKeyFromKeychain() {
*/
function saveCache() {
return __awaiter(this, void 0, void 0, function* () {
const jobStatus = util_1.isJobStatusSuccess();
const cache = core.getInput(constants.INPUT_CACHE);
return cache ? cache_1.save(cache) : Promise.resolve();
return jobStatus && cache ? cache_1.save(cache) : Promise.resolve();
});
}
/**
@ -9894,7 +9896,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getToolcachePath = exports.isVersionSatisfies = exports.getDownloadArchiveExtension = exports.extractJdkFile = exports.getVersionFromToolcachePath = exports.getBooleanInput = exports.getTempDir = void 0;
exports.isJobStatusSuccess = exports.getToolcachePath = exports.isVersionSatisfies = exports.getDownloadArchiveExtension = exports.extractJdkFile = exports.getVersionFromToolcachePath = exports.getBooleanInput = exports.getTempDir = void 0;
const os_1 = __importDefault(__webpack_require__(87));
const path_1 = __importDefault(__webpack_require__(622));
const fs = __importStar(__webpack_require__(747));
@ -9965,6 +9967,11 @@ function getToolcachePath(toolName, version, architecture) {
return null;
}
exports.getToolcachePath = getToolcachePath;
function isJobStatusSuccess() {
const jobStatus = core.getInput('job-status');
return jobStatus === 'success';
}
exports.isJobStatusSuccess = isJobStatusSuccess;
/***/ }),

7
dist/setup/index.js vendored
View file

@ -19083,7 +19083,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getToolcachePath = exports.isVersionSatisfies = exports.getDownloadArchiveExtension = exports.extractJdkFile = exports.getVersionFromToolcachePath = exports.getBooleanInput = exports.getTempDir = void 0;
exports.isJobStatusSuccess = exports.getToolcachePath = exports.isVersionSatisfies = exports.getDownloadArchiveExtension = exports.extractJdkFile = exports.getVersionFromToolcachePath = exports.getBooleanInput = exports.getTempDir = void 0;
const os_1 = __importDefault(__webpack_require__(87));
const path_1 = __importDefault(__webpack_require__(622));
const fs = __importStar(__webpack_require__(747));
@ -19154,6 +19154,11 @@ function getToolcachePath(toolName, version, architecture) {
return null;
}
exports.getToolcachePath = getToolcachePath;
function isJobStatusSuccess() {
const jobStatus = core.getInput('job-status');
return jobStatus === 'success';
}
exports.isJobStatusSuccess = isJobStatusSuccess;
/***/ }),