mirror of
https://github.com/actions/setup-java.git
synced 2025-03-13 09:37:03 +00:00
fix: remove the OS name from cache key
This commit is contained in:
parent
7b921a1561
commit
30c9ec6245
3 changed files with 9 additions and 9 deletions
6
dist/cleanup/index.js
vendored
6
dist/cleanup/index.js
vendored
|
@ -64569,14 +64569,14 @@ function findPackageManager(id) {
|
|||
exports.findPackageManager = findPackageManager;
|
||||
/**
|
||||
* A function that generates a cache key to use.
|
||||
* Format of the generated key will be "${{ platform }}-${{ id }}-${{ fileHash }}"".
|
||||
* Format of the generated key will be "setup-java-${{ id }}-${{ fileHash }}"".
|
||||
* If there is no file matched to {@link PackageManager.path}, the generated key ends with a dash (-).
|
||||
* @see {@link https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows#matching-a-cache-key|spec of cache key}
|
||||
*/
|
||||
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 `${CACHE_KEY_PREFIX}-${packageManager.id}-${hash}`;
|
||||
});
|
||||
}
|
||||
exports.computeCacheKey = computeCacheKey;
|
||||
|
@ -64594,7 +64594,7 @@ function restore(id) {
|
|||
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}`
|
||||
`${CACHE_KEY_PREFIX}-${id}`
|
||||
]);
|
||||
if (matchedKey) {
|
||||
core.saveState(CACHE_MATCHED_KEY, matchedKey);
|
||||
|
|
6
dist/setup/index.js
vendored
6
dist/setup/index.js
vendored
|
@ -18956,14 +18956,14 @@ function findPackageManager(id) {
|
|||
exports.findPackageManager = findPackageManager;
|
||||
/**
|
||||
* A function that generates a cache key to use.
|
||||
* Format of the generated key will be "${{ platform }}-${{ id }}-${{ fileHash }}"".
|
||||
* Format of the generated key will be "setup-java-${{ id }}-${{ fileHash }}"".
|
||||
* If there is no file matched to {@link PackageManager.path}, the generated key ends with a dash (-).
|
||||
* @see {@link https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows#matching-a-cache-key|spec of cache key}
|
||||
*/
|
||||
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 `${CACHE_KEY_PREFIX}-${packageManager.id}-${hash}`;
|
||||
});
|
||||
}
|
||||
exports.computeCacheKey = computeCacheKey;
|
||||
|
@ -18981,7 +18981,7 @@ function restore(id) {
|
|||
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}`
|
||||
`${CACHE_KEY_PREFIX}-${id}`
|
||||
]);
|
||||
if (matchedKey) {
|
||||
core.saveState(CACHE_MATCHED_KEY, matchedKey);
|
||||
|
|
|
@ -45,13 +45,13 @@ export function findPackageManager(id: string): PackageManager {
|
|||
|
||||
/**
|
||||
* A function that generates a cache key to use.
|
||||
* Format of the generated key will be "${{ platform }}-${{ id }}-${{ fileHash }}"".
|
||||
* Format of the generated key will be "setup-java-${{ id }}-${{ fileHash }}"".
|
||||
* If there is no file matched to {@link PackageManager.path}, the generated key ends with a dash (-).
|
||||
* @see {@link https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows#matching-a-cache-key|spec of cache key}
|
||||
*/
|
||||
export async function computeCacheKey(packageManager: PackageManager) {
|
||||
const hash = await glob.hashFiles(packageManager.pattern.join('\n'));
|
||||
return `${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${packageManager.id}-${hash}`;
|
||||
return `${CACHE_KEY_PREFIX}-${packageManager.id}-${hash}`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -73,7 +73,7 @@ export async function restore(id: string) {
|
|||
}
|
||||
|
||||
const matchedKey = await cache.restoreCache(packageManager.path, primaryKey, [
|
||||
`${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${id}`
|
||||
`${CACHE_KEY_PREFIX}-${id}`
|
||||
]);
|
||||
if (matchedKey) {
|
||||
core.saveState(CACHE_MATCHED_KEY, matchedKey);
|
||||
|
|
Loading…
Add table
Reference in a new issue