mirror of
https://github.com/actions/setup-java.git
synced 2025-04-22 02:46:46 +00:00
Merge 0f6dbb0a05
into 0aa6f2a84f
This commit is contained in:
commit
02604c7805
7 changed files with 39 additions and 25 deletions
12
dist/cleanup/index.js
vendored
12
dist/cleanup/index.js
vendored
|
@ -61904,7 +61904,7 @@ function findPackageManager(id) {
|
|||
function computeCacheKey(packageManager) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const hash = yield glob.hashFiles(packageManager.pattern.join('\n'));
|
||||
return `${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${packageManager.id}-${hash}`;
|
||||
return `${process.env.RUNNER_OS}-${CACHE_KEY_PREFIX}-${packageManager.id}-${hash}`;
|
||||
});
|
||||
}
|
||||
/**
|
||||
|
@ -61920,15 +61920,17 @@ function restore(id) {
|
|||
if (primaryKey.endsWith('-')) {
|
||||
throw new Error(`No file in ${process.cwd()} matched to [${packageManager.pattern}], make sure you have checked out the target repository`);
|
||||
}
|
||||
const matchedKey = yield cache.restoreCache(packageManager.path, primaryKey, [
|
||||
`${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${id}`
|
||||
]);
|
||||
const restoreKeys = [
|
||||
`${process.env.RUNNER_OS}-${CACHE_KEY_PREFIX}-${id}-`,
|
||||
`${process.env.RUNNER_OS}-${CACHE_KEY_PREFIX}-`
|
||||
];
|
||||
const matchedKey = yield cache.restoreCache(packageManager.path, primaryKey, restoreKeys);
|
||||
if (matchedKey) {
|
||||
core.saveState(CACHE_MATCHED_KEY, matchedKey);
|
||||
core.info(`Cache restored from key: ${matchedKey}`);
|
||||
}
|
||||
else {
|
||||
core.info(`${packageManager.id} cache is not found`);
|
||||
core.info(`Cache not found for input keys: ${[primaryKey, ...restoreKeys].join(', ')}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
12
dist/setup/index.js
vendored
12
dist/setup/index.js
vendored
|
@ -18641,7 +18641,7 @@ function findPackageManager(id) {
|
|||
function computeCacheKey(packageManager) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const hash = yield glob.hashFiles(packageManager.pattern.join('\n'));
|
||||
return `${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${packageManager.id}-${hash}`;
|
||||
return `${process.env.RUNNER_OS}-${CACHE_KEY_PREFIX}-${packageManager.id}-${hash}`;
|
||||
});
|
||||
}
|
||||
/**
|
||||
|
@ -18657,15 +18657,17 @@ function restore(id) {
|
|||
if (primaryKey.endsWith('-')) {
|
||||
throw new Error(`No file in ${process.cwd()} matched to [${packageManager.pattern}], make sure you have checked out the target repository`);
|
||||
}
|
||||
const matchedKey = yield cache.restoreCache(packageManager.path, primaryKey, [
|
||||
`${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${id}`
|
||||
]);
|
||||
const restoreKeys = [
|
||||
`${process.env.RUNNER_OS}-${CACHE_KEY_PREFIX}-${id}-`,
|
||||
`${process.env.RUNNER_OS}-${CACHE_KEY_PREFIX}-`
|
||||
];
|
||||
const matchedKey = yield cache.restoreCache(packageManager.path, primaryKey, restoreKeys);
|
||||
if (matchedKey) {
|
||||
core.saveState(CACHE_MATCHED_KEY, matchedKey);
|
||||
core.info(`Cache restored from key: ${matchedKey}`);
|
||||
}
|
||||
else {
|
||||
core.info(`${packageManager.id} cache is not found`);
|
||||
core.info(`Cache not found for input keys: ${[primaryKey, ...restoreKeys].join(', ')}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue