File tree Expand file tree Collapse file tree 4 files changed +8
-0
lines changed Expand file tree Collapse file tree 4 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,8 @@ The action has a built-in functionality for caching and restoring dependencies.
70
70
- gradle : ` **/*.gradle*` , `**/gradle-wrapper.properties`
71
71
- maven : ` **/pom.xml`
72
72
73
+ The workflow output `cache-hit` is set to indicate if an exact match was found for the key [as actions/cache does](https://github.com/actions/cache/tree/main#outputs).
74
+
73
75
The cache input is optional, and caching is turned off by default.
74
76
75
77
# ### Caching gradle dependencies
Original file line number Diff line number Diff line change @@ -61925,9 +61925,11 @@ function restore(id) {
61925
61925
]);
61926
61926
if (matchedKey) {
61927
61927
core.saveState(CACHE_MATCHED_KEY, matchedKey);
61928
+ core.setOutput('cache-hit', matchedKey === primaryKey);
61928
61929
core.info(`Cache restored from key: ${matchedKey}`);
61929
61930
}
61930
61931
else {
61932
+ core.setOutput('cache-hit', false);
61931
61933
core.info(`${packageManager.id} cache is not found`);
61932
61934
}
61933
61935
});
Original file line number Diff line number Diff line change @@ -18662,9 +18662,11 @@ function restore(id) {
18662
18662
]);
18663
18663
if (matchedKey) {
18664
18664
core.saveState(CACHE_MATCHED_KEY, matchedKey);
18665
+ core.setOutput('cache-hit', matchedKey === primaryKey);
18665
18666
core.info(`Cache restored from key: ${matchedKey}`);
18666
18667
}
18667
18668
else {
18669
+ core.setOutput('cache-hit', false);
18668
18670
core.info(`${packageManager.id} cache is not found`);
18669
18671
}
18670
18672
});
Original file line number Diff line number Diff line change @@ -77,8 +77,10 @@ export async function restore(id: string) {
77
77
] ) ;
78
78
if ( matchedKey ) {
79
79
core . saveState ( CACHE_MATCHED_KEY , matchedKey ) ;
80
+ core . setOutput ( 'cache-hit' , matchedKey === primaryKey ) ;
80
81
core . info ( `Cache restored from key: ${ matchedKey } ` ) ;
81
82
} else {
83
+ core . setOutput ( 'cache-hit' , false ) ;
82
84
core . info ( `${ packageManager . id } cache is not found` ) ;
83
85
}
84
86
}
You can’t perform that action at this time.
0 commit comments