diff --git a/action.yml b/action.yml
index de8fe31..244abf5 100644
--- a/action.yml
+++ b/action.yml
@@ -18,9 +18,6 @@ inputs:
     description: 'Fail the workflow if the cache is not found for the given key.'
     required: false
     default: "false"
-  saveCacheOnAnyFailure:
-    description: 'Save build cache despite of failure in the job'
-    default: 'no'
 outputs:
   cache-hit:
     description: 'A boolean value to indicate an exact match was found for the primary key'
@@ -28,7 +25,7 @@ runs:
   using: 'node16'
   main: 'dist/restore/index.js'
   post: 'dist/save/index.js'
-  post-if: (success() || (env.INPUT_SAVECACHEONANYFAILURE == 'yes'))
+  post-if: (success() || (env.SAVE_CACHE_ON_ANY_FAILURE == 'yes'))
 branding:
   icon: 'archive'
   color: 'gray-dark'
diff --git a/dist/restore/index.js b/dist/restore/index.js
index 6125dd6..14ff4d8 100644
--- a/dist/restore/index.js
+++ b/dist/restore/index.js
@@ -4940,7 +4940,7 @@ exports.checkBypass = checkBypass;
 "use strict";
 
 Object.defineProperty(exports, "__esModule", { value: true });
-exports.RefKey = exports.Events = exports.State = exports.Outputs = exports.Inputs = void 0;
+exports.RefKey = exports.Variables = exports.Events = exports.State = exports.Outputs = exports.Inputs = void 0;
 var Inputs;
 (function (Inputs) {
     Inputs["Key"] = "key";
@@ -4948,7 +4948,6 @@ var Inputs;
     Inputs["RestoreKeys"] = "restore-keys";
     Inputs["UploadChunkSize"] = "upload-chunk-size";
     Inputs["StrictRestore"] = "strict-restore";
-    Inputs["SaveCacheOnAnyFailure"] = "saveCacheOnAnyFailure";
 })(Inputs = exports.Inputs || (exports.Inputs = {}));
 var Outputs;
 (function (Outputs) {
@@ -4958,7 +4957,6 @@ var State;
 (function (State) {
     State["CachePrimaryKey"] = "CACHE_KEY";
     State["CacheMatchedKey"] = "CACHE_RESULT";
-    State["SaveCache"] = "SAVE_CACHE";
 })(State = exports.State || (exports.State = {}));
 var Events;
 (function (Events) {
@@ -4966,6 +4964,10 @@ var Events;
     Events["Push"] = "push";
     Events["PullRequest"] = "pull_request";
 })(Events = exports.Events || (exports.Events = {}));
+var Variables;
+(function (Variables) {
+    Variables["SaveCacheOnAnyFailure"] = "SAVE_CACHE_ON_ANY_FAILURE";
+})(Variables = exports.Variables || (exports.Variables = {}));
 exports.RefKey = "GITHUB_REF";
 
 
@@ -48988,12 +48990,10 @@ function run() {
             });
             const cacheKey = yield cache.restoreCache(cachePaths, primaryKey, restoreKeys);
             //Check if user wants to save cache despite of failure in any previous job
-            const saveCache = core.getInput(constants_1.Inputs.SaveCacheOnAnyFailure);
+            const saveCache = process.env[constants_1.Variables.SaveCacheOnAnyFailure];
             if (saveCache === "yes") {
-                core.saveState(constants_1.State.SaveCache, saveCache);
-                core.info(`Input saveCacheOnAnyFailure is set to yes, the cache will be saved despite of any failure in the build.`);
-                core.info(core.getState(constants_1.State.SaveCache));
-                core.info(core.getState(constants_1.State.CachePrimaryKey));
+                // core.exportVariable(Variables.SaveCacheOnAnyFailure, saveCache);
+                core.info(`Environment Variable ${constants_1.Variables.SaveCacheOnAnyFailure} is set to yes, the cache will be saved despite of any failure in the build.`);
             }
             if (!cacheKey) {
                 if (core.getInput(constants_1.Inputs.StrictRestore) == "true") {
diff --git a/dist/save/index.js b/dist/save/index.js
index 44abb18..dde5857 100644
--- a/dist/save/index.js
+++ b/dist/save/index.js
@@ -4940,7 +4940,7 @@ exports.checkBypass = checkBypass;
 "use strict";
 
 Object.defineProperty(exports, "__esModule", { value: true });
-exports.RefKey = exports.Events = exports.State = exports.Outputs = exports.Inputs = void 0;
+exports.RefKey = exports.Variables = exports.Events = exports.State = exports.Outputs = exports.Inputs = void 0;
 var Inputs;
 (function (Inputs) {
     Inputs["Key"] = "key";
@@ -4948,7 +4948,6 @@ var Inputs;
     Inputs["RestoreKeys"] = "restore-keys";
     Inputs["UploadChunkSize"] = "upload-chunk-size";
     Inputs["StrictRestore"] = "strict-restore";
-    Inputs["SaveCacheOnAnyFailure"] = "saveCacheOnAnyFailure";
 })(Inputs = exports.Inputs || (exports.Inputs = {}));
 var Outputs;
 (function (Outputs) {
@@ -4958,7 +4957,6 @@ var State;
 (function (State) {
     State["CachePrimaryKey"] = "CACHE_KEY";
     State["CacheMatchedKey"] = "CACHE_RESULT";
-    State["SaveCache"] = "SAVE_CACHE";
 })(State = exports.State || (exports.State = {}));
 var Events;
 (function (Events) {
@@ -4966,6 +4964,10 @@ var Events;
     Events["Push"] = "push";
     Events["PullRequest"] = "pull_request";
 })(Events = exports.Events || (exports.Events = {}));
+var Variables;
+(function (Variables) {
+    Variables["SaveCacheOnAnyFailure"] = "SAVE_CACHE_ON_ANY_FAILURE";
+})(Variables = exports.Variables || (exports.Variables = {}));
 exports.RefKey = "GITHUB_REF";
 
 
@@ -47300,8 +47302,6 @@ function run() {
                 return;
             }
             const state = utils.getCacheState();
-            core.info(core.getState(constants_1.State.SaveCache));
-            core.info(core.getState(constants_1.State.CachePrimaryKey));
             // 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) || core.getInput(constants_1.Inputs.Key);
             if (!primaryKey) {
diff --git a/src/constants.ts b/src/constants.ts
index 2233f77..81a51eb 100644
--- a/src/constants.ts
+++ b/src/constants.ts
@@ -3,8 +3,7 @@ export enum Inputs {
     Path = "path",
     RestoreKeys = "restore-keys",
     UploadChunkSize = "upload-chunk-size",
-    StrictRestore = "strict-restore",
-    SaveCacheOnAnyFailure = "saveCacheOnAnyFailure"
+    StrictRestore = "strict-restore"
 }
 
 export enum Outputs {
@@ -13,8 +12,7 @@ export enum Outputs {
 
 export enum State {
     CachePrimaryKey = "CACHE_KEY",
-    CacheMatchedKey = "CACHE_RESULT",
-    SaveCache = "SAVE_CACHE"
+    CacheMatchedKey = "CACHE_RESULT"
 }
 
 export enum Events {
@@ -23,4 +21,7 @@ export enum Events {
     PullRequest = "pull_request"
 }
 
+export enum Variables {
+    SaveCacheOnAnyFailure = "SAVE_CACHE_ON_ANY_FAILURE"
+}
 export const RefKey = "GITHUB_REF";
diff --git a/src/restore.ts b/src/restore.ts
index f7fb731..7c38b93 100644
--- a/src/restore.ts
+++ b/src/restore.ts
@@ -1,7 +1,7 @@
 import * as cache from "@actions/cache";
 import * as core from "@actions/core";
 
-import { Events, Inputs, State } from "./constants";
+import { Events, Inputs, State, Variables } from "./constants";
 import * as utils from "./utils/actionUtils";
 
 async function run(): Promise<void> {
@@ -36,14 +36,12 @@ async function run(): Promise<void> {
         );
 
         //Check if user wants to save cache despite of failure in any previous job
-        const saveCache = core.getInput(Inputs.SaveCacheOnAnyFailure);
+        const saveCache = process.env[Variables.SaveCacheOnAnyFailure];
         if (saveCache === "yes") {
-            core.saveState(State.SaveCache, saveCache);
+            // core.exportVariable(Variables.SaveCacheOnAnyFailure, saveCache);
             core.info(
-                `Input saveCacheOnAnyFailure is set to yes, the cache will be saved despite of any failure in the build.`
+                `Environment Variable ${Variables.SaveCacheOnAnyFailure} is set to yes, the cache will be saved despite of any failure in the build.`
             );
-            core.info(core.getState(State.SaveCache));
-            core.info(core.getState(State.CachePrimaryKey));
         }
 
         if (!cacheKey) {
diff --git a/src/save.ts b/src/save.ts
index 88ff7bc..d30f553 100644
--- a/src/save.ts
+++ b/src/save.ts
@@ -25,8 +25,7 @@ async function run(): Promise<void> {
         }
 
         const state = utils.getCacheState();
-        core.info(core.getState(State.SaveCache));
-        core.info(core.getState(State.CachePrimaryKey));
+
         // Inputs are re-evaluted before the post action, so we want the original key used for restore
         const primaryKey =
             core.getState(State.CachePrimaryKey) || core.getInput(Inputs.Key);