3
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-12-25 14:26:57 +00:00

Merge tag 'v4.2.3' into v4

This commit is contained in:
Cyril Rohr 2025-05-27 14:14:08 +02:00
commit ae0e379aa0
No known key found for this signature in database
51 changed files with 47147 additions and 9608 deletions

View file

@ -68,6 +68,9 @@ export async function restoreImpl(
}
if (!cacheKey) {
// `cache-hit` is intentionally not set to `false` here to preserve existing behavior
// See https://github.com/actions/cache/issues/1466
if (failOnCacheMiss) {
throw new Error(
`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`
@ -79,7 +82,6 @@ export async function restoreImpl(
...restoreKeys
].join(", ")}`
);
return;
}

View file

@ -7,7 +7,13 @@ export function isGhes(): boolean {
const ghUrl = new URL(
process.env["GITHUB_SERVER_URL"] || "https://github.com"
);
return ghUrl.hostname.toUpperCase() !== "GITHUB.COM";
const hostname = ghUrl.hostname.trimEnd().toUpperCase();
const isGitHubHost = hostname === "GITHUB.COM";
const isGitHubEnterpriseCloudHost = hostname.endsWith(".GHE.COM");
const isLocalHost = hostname.endsWith(".LOCALHOST");
return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
}
export function isExactKeyMatch(key: string, cacheKey?: string): boolean {