From 186b99ef06deaa18471fe4efa80002511ebb0617 Mon Sep 17 00:00:00 2001 From: ChanTsune <41658782+ChanTsune@users.noreply.github.com> Date: Sat, 11 Apr 2026 23:32:14 +0900 Subject: [PATCH] feat: add cache-save-if input to propagate save-if to Swatinem/rust-cache --- README.md | 1 + action.yml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 5bd87e7..7f1cb43 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ Afterward, the `components` and `target` specified via inputs are installed in a | `cache-provider` | Propagates the value to [`Swatinem/rust-cache`] as `cache-provider` | 'github' | | `cache-all-crates` | Propagates the value to [`Swatinem/rust-cache`] as `cache-all-crates` | false | | `cache-workspace-crates` | Propagates the value to [`Swatinem/rust-cache`] as `cache-workspace-crates` | false | +| `cache-save-if` | Propagates the value to [`Swatinem/rust-cache`] as `save-if` | true | | `matcher` | Enable problem matcher to surface build messages and formatting issues | true | | `rustflags` | Set the value of `RUSTFLAGS` (set to empty string to avoid overwriting existing flags) | "-D warnings" | | `override` | Setup the last installed toolchain as the default via `rustup override` | true | diff --git a/action.yml b/action.yml index ee1e79f..df428d4 100644 --- a/action.yml +++ b/action.yml @@ -57,6 +57,10 @@ inputs: description: "Determines which crates are cached. If `true` all crates will be cached, otherwise only dependent crates will be cached." required: false default: "false" + cache-save-if: + description: "Determines whether the cache should be saved. If `false`, the cache is only restored." + required: false + default: "true" matcher: description: "Enable the Rust problem matcher" required: false @@ -248,5 +252,6 @@ runs: cache-provider: ${{inputs.cache-provider}} cache-all-crates: ${{inputs.cache-all-crates}} cache-workspace-crates: ${{inputs.cache-workspace-crates}} + save-if: ${{inputs.cache-save-if}} key: ${{inputs.cache-key}} shared-key: ${{inputs.cache-shared-key}}