diff --git a/README.md b/README.md index 3b713486bc..9a0dd8132b 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,10 @@ jobs: # Optional: show only new issues if it's a pull request. The default value is `false`. # only-new-issues: true + # Optional: if set to true then the all caching functionality will be complete disabled, + # takes precedence over all other caching options. + # skip-cache: true + # Optional: if set to true then the action don't cache or restore ~/go/pkg. # skip-pkg-cache: true diff --git a/action.yml b/action.yml index 10521abbe5..45e757b365 100644 --- a/action.yml +++ b/action.yml @@ -20,6 +20,12 @@ inputs: description: "if set to true and the action runs on a pull request - the action outputs only newly found issues" default: false required: true + skip-cache: + description: | + if set to true then the all caching functionality will be complete disabled, + takes precedence over all other caching options. + default: false + required: true skip-pkg-cache: description: "if set to true then the action doesn't cache or restore ~/go/pkg." default: false diff --git a/dist/post_run/index.js b/dist/post_run/index.js index 608d629503..4a935381b5 100644 --- a/dist/post_run/index.js +++ b/dist/post_run/index.js @@ -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.`); diff --git a/dist/run/index.js b/dist/run/index.js index f3f4e07e1e..3994c540ae 100644 --- a/dist/run/index.js +++ b/dist/run/index.js @@ -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.`); diff --git a/src/cache.ts b/src/cache.ts index 85b5b79847..c29f29542d 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -72,6 +72,8 @@ async function buildCacheKeys(): Promise { } export async function restoreCache(): Promise { + if (core.getInput(`skip-cache`, { required: true }).trim() == "true") return + if (!utils.isValidEvent()) { utils.logWarning( `Event Validation Error: The event type ${process.env[Events.Key]} is not supported because it's not tied to a branch or tag ref.` @@ -112,6 +114,8 @@ export async function restoreCache(): Promise { } export async function saveCache(): Promise { + if (core.getInput(`skip-cache`, { required: true }).trim() == "true") return + // Validate inputs, this can cause task failure if (!utils.isValidEvent()) { utils.logWarning(