From 1001c07830a5c6e09f58126c571868a1a84fcb76 Mon Sep 17 00:00:00 2001
From: Matt Johnson-Pint <matt.johnson-pint@sentry.io>
Date: Sat, 26 Nov 2022 09:39:57 -0800
Subject: [PATCH] build and commit dist

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

diff --git a/dist/restore/index.js b/dist/restore/index.js
index a840efa..afc8d35 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["ReevaluateKey"] = "reevaluate-key";
 })(Inputs = exports.Inputs || (exports.Inputs = {}));
 var Outputs;
 (function (Outputs) {
diff --git a/dist/save/index.js b/dist/save/index.js
index bd9f422..bdc555c 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["ReevaluateKey"] = "reevaluate-key";
 })(Inputs = exports.Inputs || (exports.Inputs = {}));
 var Outputs;
 (function (Outputs) {
@@ -47287,6 +47288,7 @@ const utils = __importStar(__webpack_require__(443));
 // throw an uncaught exception.  Instead of failing this action, just warn.
 process.on("uncaughtException", e => utils.logWarning(e.message));
 function run() {
+    var _a;
     return __awaiter(this, void 0, void 0, function* () {
         try {
             if (!utils.isCacheFeatureAvailable()) {
@@ -47297,11 +47299,18 @@ function run() {
                 return;
             }
             const state = utils.getCacheState();
-            // Inputs are re-evaluted before the post action, so we want the original key used for restore
-            const primaryKey = core.getState(constants_1.State.CachePrimaryKey);
-            if (!primaryKey) {
-                utils.logWarning(`Error retrieving key from state.`);
-                return;
+            let primaryKey;
+            if (((_a = core.getInput(constants_1.Inputs.ReevaluateKey)) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "true") {
+                // Inputs are re-evaluated before the post action
+                primaryKey = core.getInput(constants_1.Inputs.Key);
+            }
+            else {
+                // Get the original key used for restore from the cache
+                primaryKey = core.getState(constants_1.State.CachePrimaryKey);
+                if (!primaryKey) {
+                    utils.logWarning(`Error retrieving key from state.`);
+                    return;
+                }
             }
             if (utils.isExactKeyMatch(primaryKey, state)) {
                 core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`);