Loading src/cacheHttpClient.ts +2 −4 Changes for src/cacheHttpClient.ts: 2 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ import { ArtifactCacheEntry } from "./contracts"; export async function getCacheEntry( keys: string[] ): Promise<ArtifactCacheEntry> { ): Promise<ArtifactCacheEntry | null> { const cacheUrl = getCacheUrl(); const token = process.env["ACTIONS_RUNTIME_TOKEN"] || ""; const bearerCredentialHandler = new BearerCredentialHandler(token); Loading @@ -28,9 +28,7 @@ export async function getCacheEntry( getRequestOptions() ); if (response.statusCode === 204) { throw new Error( `Cache not found for input keys: ${JSON.stringify(keys)}.` ); return null; } if (response.statusCode !== 200) { throw new Error(`Cache service responded with ${response.statusCode}`); Loading src/restore.ts +8 −2 Changes for src/restore.ts: 8 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -49,14 +49,20 @@ async function run() { } try { const cacheEntry = await cacheHttpClient.getCacheEntry(keys); if (!cacheEntry) { core.info( `Cache not found for input keys: ${JSON.stringify(keys)}.` ); return; } let archivePath = path.join( await utils.createTempDirectory(), "cache.tgz" ); core.debug(`Archive Path: ${archivePath}`); const cacheEntry = await cacheHttpClient.getCacheEntry(keys); // Store the cache result utils.setCacheState(cacheEntry); Loading Loading
src/cacheHttpClient.ts +2 −4 Changes for src/cacheHttpClient.ts: 2 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ import { ArtifactCacheEntry } from "./contracts"; export async function getCacheEntry( keys: string[] ): Promise<ArtifactCacheEntry> { ): Promise<ArtifactCacheEntry | null> { const cacheUrl = getCacheUrl(); const token = process.env["ACTIONS_RUNTIME_TOKEN"] || ""; const bearerCredentialHandler = new BearerCredentialHandler(token); Loading @@ -28,9 +28,7 @@ export async function getCacheEntry( getRequestOptions() ); if (response.statusCode === 204) { throw new Error( `Cache not found for input keys: ${JSON.stringify(keys)}.` ); return null; } if (response.statusCode !== 200) { throw new Error(`Cache service responded with ${response.statusCode}`); Loading
src/restore.ts +8 −2 Changes for src/restore.ts: 8 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -49,14 +49,20 @@ async function run() { } try { const cacheEntry = await cacheHttpClient.getCacheEntry(keys); if (!cacheEntry) { core.info( `Cache not found for input keys: ${JSON.stringify(keys)}.` ); return; } let archivePath = path.join( await utils.createTempDirectory(), "cache.tgz" ); core.debug(`Archive Path: ${archivePath}`); const cacheEntry = await cacheHttpClient.getCacheEntry(keys); // Store the cache result utils.setCacheState(cacheEntry); Loading