File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,12 @@ sensible defaults.
5353 # Determines if the cache should be saved even when the workflow has failed.
5454 # default: "false"
5555 cache-on-failure : " "
56+
57+ # Determiners whether the cache should be saved.
58+ # If `false`, the cache is only restored.
59+ # Useful for jobs where the matrix is additive e.g. additional Cargo features.
60+ # default: "true"
61+ save-if : " "
5662` ` `
5763
5864Further examples are available in the [.github/workflows](./.github/workflows/) directory.
Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ inputs:
2828 cache-on-failure :
2929 description : " Cache even if the build fails. Defaults to false."
3030 required : false
31+ save-if :
32+ description : " Determiners whether the cache should be saved. If `false`, the cache is only restored."
33+ required : false
34+ default : " true"
3135outputs :
3236 cache-hit :
3337 description : " A boolean value that indicates an exact match was found."
Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ process.on("uncaughtException", (e) => {
1313} ) ;
1414
1515async function run ( ) {
16- if ( ! cache . isFeatureAvailable ( ) ) {
16+ const save = core . getInput ( "save-if" ) . toLowerCase ( ) || "true" ;
17+
18+ if ( ! ( cache . isFeatureAvailable ( ) && save === "true" ) ) {
1719 return ;
1820 }
1921
You can’t perform that action at this time.
0 commit comments