diff --git a/README.md b/README.md index 14b77caa4c..70d2ff2d91 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,10 @@ jobs: # takes precedence over all other caching options. # skip-cache: true + # Optional: if set to true, caches will not be saved, but they may still be restored, + # subject to other options + # skip-save-cache: true + # Optional: if set to true, then the action won't cache or restore ~/go/pkg. # skip-pkg-cache: true diff --git a/action.yml b/action.yml index 3b3ea21c27..7ab3103190 100644 --- a/action.yml +++ b/action.yml @@ -29,6 +29,12 @@ inputs: takes precedence over all other caching options. default: 'false' required: false + skip-save-cache: + description: | + if set to true then the action will not save any caches, but it may still + restore existing caches, subject to other options. + default: 'false' + required: false 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 91fbc1b387..89c0c1fbbd 100644 --- a/dist/post_run/index.js +++ b/dist/post_run/index.js @@ -88900,6 +88900,8 @@ exports.restoreCache = restoreCache; async function saveCache() { if (core.getInput(`skip-cache`, { required: true }).trim() == "true") return; + if (core.getInput(`skip-save-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 6e8230c265..d4c8ce078d 100644 --- a/dist/run/index.js +++ b/dist/run/index.js @@ -88900,6 +88900,8 @@ exports.restoreCache = restoreCache; async function saveCache() { if (core.getInput(`skip-cache`, { required: true }).trim() == "true") return; + if (core.getInput(`skip-save-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 cb8f828ac9..ed1da7517a 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -116,6 +116,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-save-cache`, { required: true }).trim() == "true") return // Validate inputs, this can cause task failure if (!utils.isValidEvent()) {