From 481f18bdd4de00f41385ea735da1d18fd9aedf55 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 7 Aug 2025 23:01:02 -0700 Subject: [PATCH] add restore-only --- action.yml | 3 +++ src/cache-save.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 9946e47..3e17e16 100644 --- a/action.yml +++ b/action.yml @@ -15,6 +15,9 @@ inputs: cache: description: Used to specify whether caching is needed. Set to true, if you'd like to enable caching. default: true + restore-only: + description: Do not save the cache. Only applies if cache is enabled. + default: false cache-dependency-path: description: 'Used to specify the path to a dependency file - go.sum' architecture: diff --git a/src/cache-save.ts b/src/cache-save.ts index 5baefde..6d3adc6 100644 --- a/src/cache-save.ts +++ b/src/cache-save.ts @@ -18,7 +18,8 @@ process.on('uncaughtException', e => { export async function run(earlyExit?: boolean) { try { const cacheInput = core.getBooleanInput('cache'); - if (cacheInput) { + const restoreOnly = core.getBooleanInput('restoreOnly'); + if (cacheInput && !restoreOnly) { await cachePackages(); if (earlyExit) {