diff --git a/CHANGELOG.md b/CHANGELOG.md index 59f2e74..4c7243d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2.2.0 + +- Add new `save-if` option to always restore, but only conditionally save the cache. + ## 2.1.0 - Only hash `Cargo.{lock,toml}` files in the configured workspace directories. diff --git a/dist/save/index.js b/dist/save/index.js index 5229d37..515a782 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -64922,7 +64922,8 @@ process.on("uncaughtException", (e) => { } }); async function run() { - if (!cache.isFeatureAvailable()) { + const save = core.getInput("save-if").toLowerCase() || "true"; + if (!(cache.isFeatureAvailable() && save === "true")) { return; } try { diff --git a/package-lock.json b/package-lock.json index 4b66c9b..f0e8ac3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "rust-cache", - "version": "2.1.0", + "version": "2.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "2.1.0", + "version": "2.2.0", "license": "LGPL-3.0", "dependencies": { "@actions/cache": "^3.0.6", diff --git a/package.json b/package.json index 9fb820d..4c2c62b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "rust-cache", - "version": "2.1.0", + "version": "2.2.0", "description": "A GitHub Action that implements smart caching for rust/cargo projects with sensible defaults.", "keywords": [ "actions",