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.
53
53
# Determines if the cache should be saved even when the workflow has failed.
54
54
# default: "false"
55
55
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 : " "
56
62
` ` `
57
63
58
64
Further 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:
28
28
cache-on-failure :
29
29
description : " Cache even if the build fails. Defaults to false."
30
30
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"
31
35
outputs :
32
36
cache-hit :
33
37
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) => {
13
13
} ) ;
14
14
15
15
async function run ( ) {
16
- if ( ! cache . isFeatureAvailable ( ) ) {
16
+ const save = core . getInput ( "save-if" ) . toLowerCase ( ) || "true" ;
17
+
18
+ if ( ! ( cache . isFeatureAvailable ( ) && save === "true" ) ) {
17
19
return ;
18
20
}
19
21
You can’t perform that action at this time.
0 commit comments