mirror of
https://github.com/actions/setup-java.git
synced 2026-07-30 17:19:27 +08:00
Fix caching when wrapper distributions are absent (#1151)
* Fix missing wrapper cache distributions Skip optional Maven and Gradle wrapper cache saves when their distribution paths do not exist, while allowing the main dependency cache to save. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a43181c5-548d-4293-be58-b76c03cece79 * Use resolved paths for wrapper cache saves Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a43181c5-548d-4293-be58-b76c03cece79 * Rebuild action distributions Regenerate the setup and cleanup bundles after updating additional cache saves to use resolved paths. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a43181c5-548d-4293-be58-b76c03cece79 --------- Copilot-Session: a43181c5-548d-4293-be58-b76c03cece79
This commit is contained in:
Vendored
+9
-1
@@ -97988,8 +97988,16 @@ async function saveAdditionalCache(packageManager, additionalCache) {
|
||||
info(`Cache hit occurred on the ${additionalCache.name} primary key ${primaryKey}, not saving cache.`);
|
||||
return;
|
||||
}
|
||||
const globber = await create(additionalCache.path.join('\n'), {
|
||||
implicitDescendants: false
|
||||
});
|
||||
const cachePaths = await globber.glob();
|
||||
if (cachePaths.length === 0) {
|
||||
core_debug(`${additionalCache.name} cache paths do not exist, not saving cache.`);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const cacheId = await cache_saveCache(additionalCache.path, primaryKey);
|
||||
const cacheId = await cache_saveCache(cachePaths, primaryKey);
|
||||
if (cacheId === -1) {
|
||||
core_debug(`${additionalCache.name} cache was not saved for the key: ${primaryKey}`);
|
||||
return;
|
||||
|
||||
Vendored
+9
-1
@@ -129229,8 +129229,16 @@ async function saveAdditionalCache(packageManager, additionalCache) {
|
||||
core.info(`Cache hit occurred on the ${additionalCache.name} primary key ${primaryKey}, not saving cache.`);
|
||||
return;
|
||||
}
|
||||
const globber = await glob.create(additionalCache.path.join('\n'), {
|
||||
implicitDescendants: false
|
||||
});
|
||||
const cachePaths = await globber.glob();
|
||||
if (cachePaths.length === 0) {
|
||||
core.debug(`${additionalCache.name} cache paths do not exist, not saving cache.`);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const cacheId = await cache.saveCache(additionalCache.path, primaryKey);
|
||||
const cacheId = await cache.saveCache(cachePaths, primaryKey);
|
||||
if (cacheId === -1) {
|
||||
core.debug(`${additionalCache.name} cache was not saved for the key: ${primaryKey}`);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user