Add cache-restore-only input

This commit is contained in:
Sergey Dolin 2023-03-31 08:27:15 +02:00
parent 41c2024c46
commit aef6ecca6c
3 changed files with 7 additions and 2 deletions

View file

@ -17,6 +17,9 @@ inputs:
default: true default: true
cache-dependency-path: cache-dependency-path:
description: 'Used to specify the path to a dependency file - go.sum' 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: architecture:
description: 'Target architecture for Go to use. Examples: x86, x64. Will use system architecture by default.' description: 'Target architecture for Go to use. Examples: x86, x64. Will use system architecture by default.'
outputs: outputs:

View file

@ -60363,7 +60363,8 @@ function run() {
exports.run = run; exports.run = run;
const cachePackages = () => __awaiter(void 0, void 0, void 0, function* () { const cachePackages = () => __awaiter(void 0, void 0, void 0, function* () {
const cacheInput = core.getBooleanInput('cache'); const cacheInput = core.getBooleanInput('cache');
if (!cacheInput) { const cacheRestoreOnly = core.getBooleanInput('cache-restore-only');
if (!cacheInput || cacheRestoreOnly) {
return; return;
} }
const packageManager = 'default'; const packageManager = 'default';

View file

@ -29,7 +29,8 @@ export async function run() {
const cachePackages = async () => { const cachePackages = async () => {
const cacheInput = core.getBooleanInput('cache'); const cacheInput = core.getBooleanInput('cache');
if (!cacheInput) { const cacheRestoreOnly = core.getBooleanInput('cache-restore-only');
if (!cacheInput || cacheRestoreOnly) {
return; return;
} }