Add better comments

This commit is contained in:
Sampark Sharma
2022-12-12 10:58:58 +00:00
committed by GitHub
parent d7ae8cd1ef
commit cad074ceef
3 changed files with 13 additions and 4 deletions
+2
View File
@@ -104,6 +104,7 @@ export async function getCacheEntry(
httpClient.getJson<ArtifactCacheEntry>(getCacheApiUrl(resource))
)
if (response.statusCode === 204) {
// Cache not found
return null
}
if (!isSuccessStatusCode(response.statusCode)) {
@@ -113,6 +114,7 @@ export async function getCacheEntry(
const cacheResult = response.result
const cacheDownloadUrl = cacheResult?.archiveLocation
if (!cacheDownloadUrl) {
// Cache achiveLocation not found
throw new Error('Cache not found.')
}
core.setSecret(cacheDownloadUrl)