From 0756d0f6e959d0a24b766ba323c0434e8a03753c Mon Sep 17 00:00:00 2001
From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com>
Date: Thu, 17 Nov 2022 18:52:25 +0000
Subject: [PATCH] Updated action code

---
 dist/restore/index.js | 5 +++++
 dist/save/index.js    | 1 +
 2 files changed, 6 insertions(+)

diff --git a/dist/restore/index.js b/dist/restore/index.js
index a840efa..5a803e8 100644
--- a/dist/restore/index.js
+++ b/dist/restore/index.js
@@ -4947,6 +4947,7 @@ var Inputs;
     Inputs["Path"] = "path";
     Inputs["RestoreKeys"] = "restore-keys";
     Inputs["UploadChunkSize"] = "upload-chunk-size";
+    Inputs["StrictRestore"] = "strict-restore";
 })(Inputs = exports.Inputs || (exports.Inputs = {}));
 var Outputs;
 (function (Outputs) {
@@ -48995,6 +48996,10 @@ function run() {
             utils.setCacheState(cacheKey);
             const isExactKeyMatch = utils.isExactKeyMatch(primaryKey, cacheKey);
             utils.setCacheHitOutput(isExactKeyMatch);
+            if (!isExactKeyMatch && core.getInput(constants_1.Inputs.StrictRestore) == "true") {
+                core.info("Cache with exact key not found, hence exiting the workflow as strict-restore is set to true");
+                return;
+            }
             core.info(`Cache restored from key: ${cacheKey}`);
         }
         catch (error) {
diff --git a/dist/save/index.js b/dist/save/index.js
index 6bf1854..8f63267 100644
--- a/dist/save/index.js
+++ b/dist/save/index.js
@@ -4947,6 +4947,7 @@ var Inputs;
     Inputs["Path"] = "path";
     Inputs["RestoreKeys"] = "restore-keys";
     Inputs["UploadChunkSize"] = "upload-chunk-size";
+    Inputs["StrictRestore"] = "strict-restore";
 })(Inputs = exports.Inputs || (exports.Inputs = {}));
 var Outputs;
 (function (Outputs) {