From aa9e491cf86376446b1ce7d9c6c00c45e8edbde8 Mon Sep 17 00:00:00 2001 From: Tomas Dabasinskas Date: Fri, 15 Oct 2021 13:30:39 +0300 Subject: [PATCH 1/6] Add skip-cache parameter --- action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/action.yml b/action.yml index 10521abbe5..df937a66a8 100644 --- a/action.yml +++ b/action.yml @@ -28,6 +28,10 @@ inputs: description: "if set to true then the action doesn't cache or restore ~/.cache/go-build." default: false required: true + skip-cache: + description: "if set to true then the all caching functionality willl be complete disabled." + default: false + required: true runs: using: "node16" main: "dist/run/index.js" From bb5270559b50405733e6c7be9d082a9e4f13b6b4 Mon Sep 17 00:00:00 2001 From: Tomas Dabasinskas Date: Fri, 15 Oct 2021 13:30:54 +0300 Subject: [PATCH 2/6] Update README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 3b713486bc..e7e98ba6f0 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,9 @@ jobs: # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. # skip-build-cache: true + + # Optional: if set to true then the all caching functionality willl be complete disabled. + # skip-cache: true ``` We recommend running this action in a job separate from other jobs (`go test`, etc) From 2d2273ad58610660698bfda0dba3d012077ddc36 Mon Sep 17 00:00:00 2001 From: Tomas Dabasinskas Date: Fri, 15 Oct 2021 13:37:59 +0300 Subject: [PATCH 3/6] Implement cache skipping --- src/cache.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cache.ts b/src/cache.ts index 85b5b79847..15c62b41b6 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -72,6 +72,9 @@ 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 +115,9 @@ 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( From 9a4f36fa4324c2da4ac230729fd05cffe83f666e Mon Sep 17 00:00:00 2001 From: Tomas Dabasinskas Date: Mon, 15 Nov 2021 08:56:14 +0200 Subject: [PATCH 4/6] Run prettier --- src/cache.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cache.ts b/src/cache.ts index 15c62b41b6..c29f29542d 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -72,8 +72,7 @@ async function buildCacheKeys(): Promise { } export async function restoreCache(): Promise { - if (core.getInput(`skip-cache`, { required: true }).trim() == "true") - return + if (core.getInput(`skip-cache`, { required: true }).trim() == "true") return if (!utils.isValidEvent()) { utils.logWarning( @@ -115,8 +114,7 @@ export async function restoreCache(): Promise { } export async function saveCache(): Promise { - if (core.getInput(`skip-cache`, { required: true }).trim() == "true") - return + if (core.getInput(`skip-cache`, { required: true }).trim() == "true") return // Validate inputs, this can cause task failure if (!utils.isValidEvent()) { From b0fe4a4ca2c0593809b39671b177e8604aeb941a Mon Sep 17 00:00:00 2001 From: Sergey Vilgelm Date: Sat, 26 Feb 2022 08:07:24 -0800 Subject: [PATCH 5/6] update descriptions --- README.md | 7 ++++--- action.yml | 10 ++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e7e98ba6f0..9a0dd8132b 100644 --- a/README.md +++ b/README.md @@ -55,14 +55,15 @@ 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 # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. # skip-build-cache: true - - # Optional: if set to true then the all caching functionality willl be complete disabled. - # skip-cache: true ``` We recommend running this action in a job separate from other jobs (`go test`, etc) diff --git a/action.yml b/action.yml index df937a66a8..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 @@ -28,10 +34,6 @@ inputs: description: "if set to true then the action doesn't cache or restore ~/.cache/go-build." default: false required: true - skip-cache: - description: "if set to true then the all caching functionality willl be complete disabled." - default: false - required: true runs: using: "node16" main: "dist/run/index.js" From 5e8edc3cf54f035e90845f643d8556dfb11b71d8 Mon Sep 17 00:00:00 2001 From: Sergey Vilgelm Date: Sat, 26 Feb 2022 08:08:11 -0800 Subject: [PATCH 6/6] re-build dist --- dist/post_run/index.js | 4 ++++ dist/run/index.js | 4 ++++ 2 files changed, 8 insertions(+) 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.`);