diff --git a/action.yml b/action.yml index e3a21c1f3..50e2d5ed3 100644 --- a/action.yml +++ b/action.yml @@ -17,6 +17,9 @@ inputs: default: true cache-dependency-path: description: 'Used to specify the path to a dependency file - go.sum' + cache-restore-only: + description: 'Set this option to true if you do not want to modify the cache from the previous build' + default: false architecture: description: 'Target architecture for Go to use. Examples: x86, x64. Will use system architecture by default.' outputs: diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js index 8775623d6..95bcbec8b 100644 --- a/dist/cache-save/index.js +++ b/dist/cache-save/index.js @@ -60363,7 +60363,8 @@ function run() { exports.run = run; const cachePackages = () => __awaiter(void 0, void 0, void 0, function* () { const cacheInput = core.getBooleanInput('cache'); - if (!cacheInput) { + const cacheRestoreOnly = core.getBooleanInput('cache-restore-only'); + if (!cacheInput || cacheRestoreOnly) { return; } const packageManager = 'default'; diff --git a/src/cache-save.ts b/src/cache-save.ts index 584d0a697..ee633be68 100644 --- a/src/cache-save.ts +++ b/src/cache-save.ts @@ -29,7 +29,8 @@ export async function run() { const cachePackages = async () => { const cacheInput = core.getBooleanInput('cache'); - if (!cacheInput) { + const cacheRestoreOnly = core.getBooleanInput('cache-restore-only'); + if (!cacheInput || cacheRestoreOnly) { return; }