diff --git a/action.yml b/action.yml
index 48755e9df..e3ff7cc5e 100644
--- a/action.yml
+++ b/action.yml
@@ -37,7 +37,7 @@ runs:
   using: 'node20'
   main: 'dist/setup/index.js'
   post: 'dist/cache-save/index.js'
-  post-if: success()
+  post-if: 'success() && github.event.inputs.cache'
 branding:
   icon: 'code'
   color: 'yellow'