mirror of
https://gitea.com/actions/setup-java.git
synced 2026-07-09 19:22:05 +08:00
feat: expose cache-primary-key output (#597)
Expose the primary cache key computed by the caching logic as a new `cache-primary-key` action output, so workflows can compose the built-in setup-java cache key with actions/cache or actions/cache/restore across steps and dependent jobs. - src/cache.ts: set the `cache-primary-key` output in restore() - action.yml: declare the new output - README.md: document the new output - __tests__/cache.test.ts: assert the output is set - dist: rebuild Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1
dist/setup/index.js
vendored
1
dist/setup/index.js
vendored
@@ -130957,6 +130957,7 @@ async function restore(id, cacheDependencyPath) {
|
||||
const primaryKey = await computeCacheKey(packageManager, cacheDependencyPath);
|
||||
core_debug(`primary key is ${primaryKey}`);
|
||||
saveState(STATE_CACHE_PRIMARY_KEY, primaryKey);
|
||||
setOutput('cache-primary-key', primaryKey);
|
||||
// No "restoreKeys" is set, to start with a clear cache after dependency update (see https://github.com/actions/setup-java/issues/269)
|
||||
const matchedKey = await restoreCache(packageManager.path, primaryKey);
|
||||
if (matchedKey) {
|
||||
|
||||
Reference in New Issue
Block a user