Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ The action has a built-in functionality for caching and restoring dependencies.
- gradle: `**/*.gradle*`, `**/gradle-wrapper.properties`
- maven: `**/pom.xml`

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).

The cache input is optional, and caching is turned off by default.

#### Caching gradle dependencies
Expand Down
2 changes: 2 additions & 0 deletions dist/cleanup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61873,9 +61873,11 @@ function restore(id) {
]);
if (matchedKey) {
core.saveState(CACHE_MATCHED_KEY, matchedKey);
core.setOutput('cache-hit', matchedKey === primaryKey);
core.info(`Cache restored from key: ${matchedKey}`);
}
else {
core.setOutput('cache-hit', false);
core.info(`${packageManager.id} cache is not found`);
}
});
Expand Down
2 changes: 2 additions & 0 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18664,9 +18664,11 @@ function restore(id) {
]);
if (matchedKey) {
core.saveState(CACHE_MATCHED_KEY, matchedKey);
core.setOutput('cache-hit', matchedKey === primaryKey);
core.info(`Cache restored from key: ${matchedKey}`);
}
else {
core.setOutput('cache-hit', false);
core.info(`${packageManager.id} cache is not found`);
}
});
Expand Down
2 changes: 2 additions & 0 deletions src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ export async function restore(id: string) {
]);
if (matchedKey) {
core.saveState(CACHE_MATCHED_KEY, matchedKey);
core.setOutput('cache-hit', matchedKey === primaryKey);
core.info(`Cache restored from key: ${matchedKey}`);
} else {
core.setOutput('cache-hit', false);
core.info(`${packageManager.id} cache is not found`);
}
}
Expand Down