Allow to disable caching completely (#351)

* Add skip-cache parameter

* Update README

* Implement cache skipping

* Run prettier

* update descriptions

* re-build dist

Co-authored-by: Sergey Vilgelm <sergey@vilgelm.com>
This commit is contained in:
Tomas Dabasinskas
2022-02-26 18:16:23 +02:00
committed by GitHub
parent 7d5614c3eb
commit cdfc708aeb
5 changed files with 22 additions and 0 deletions

View File

@ -65066,6 +65066,8 @@ function buildCacheKeys() {
}
function restoreCache() {
return __awaiter(this, void 0, void 0, function* () {
if (core.getInput(`skip-cache`, { required: true }).trim() == "true")
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;
@ -65104,6 +65106,8 @@ function restoreCache() {
exports.restoreCache = restoreCache;
function saveCache() {
return __awaiter(this, void 0, void 0, function* () {
if (core.getInput(`skip-cache`, { required: true }).trim() == "true")
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.`);

4
dist/run/index.js vendored
View File

@ -65066,6 +65066,8 @@ function buildCacheKeys() {
}
function restoreCache() {
return __awaiter(this, void 0, void 0, function* () {
if (core.getInput(`skip-cache`, { required: true }).trim() == "true")
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;
@ -65104,6 +65106,8 @@ function restoreCache() {
exports.restoreCache = restoreCache;
function saveCache() {
return __awaiter(this, void 0, void 0, function* () {
if (core.getInput(`skip-cache`, { required: true }).trim() == "true")
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.`);