diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js
index 3177996..9632fa5 100644
--- a/dist/cache-save/index.js
+++ b/dist/cache-save/index.js
@@ -46368,6 +46368,9 @@ function run() {
 }
 exports.run = run;
 const cachePackages = () => __awaiter(void 0, void 0, void 0, function* () {
+    const cachingFlag = core.getInput('cache');
+    if (!cachingFlag)
+        return;
     const state = core.getState(constants_1.State.CacheMatchedKey);
     const primaryKey = core.getState(constants_1.State.CachePrimaryKey);
     const packageManagerInfo = yield cache_utils_1.getPackageManagerInfo();
diff --git a/src/cache-save.ts b/src/cache-save.ts
index 03a6e7a..a1a80c6 100644
--- a/src/cache-save.ts
+++ b/src/cache-save.ts
@@ -21,6 +21,10 @@ export async function run() {
 }
 
 const cachePackages = async () => {
+
+  const cachingFlag = core.getInput('cache');
+  if (!cachingFlag) return;
+
   const state = core.getState(State.CacheMatchedKey);
   const primaryKey = core.getState(State.CachePrimaryKey);