mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-03 21:43:17 +08:00
Resolved comments
This commit is contained in:
7
packages/cache/src/internal/cacheUtils.ts
vendored
7
packages/cache/src/internal/cacheUtils.ts
vendored
@@ -123,3 +123,10 @@ export function assertDefined<T>(name: string, value?: T): T {
|
||||
|
||||
return value
|
||||
}
|
||||
|
||||
export function isGhes(): boolean {
|
||||
const ghUrl = new URL(
|
||||
process.env["GITHUB_SERVER_URL"] || "https://github.com"
|
||||
);
|
||||
return ghUrl.hostname.toUpperCase() !== "GITHUB.COM";
|
||||
}
|
||||
|
||||
4
packages/cache/src/internal/contracts.d.ts
vendored
4
packages/cache/src/internal/contracts.d.ts
vendored
@@ -1,9 +1,9 @@
|
||||
import {CompressionMethod} from './constants'
|
||||
import {ITypedResponse} from '@actions/http-client/interfaces'
|
||||
import {HttpClientError} from '@actions/http-client'
|
||||
|
||||
export interface ITypedResponseWithErrorMessage<T> extends ITypedResponse<T> {
|
||||
message?: string
|
||||
typeKey?: string
|
||||
error?: HttpClientError
|
||||
}
|
||||
|
||||
export interface ArtifactCacheEntry {
|
||||
|
||||
3
packages/cache/src/internal/requestUtils.ts
vendored
3
packages/cache/src/internal/requestUtils.ts
vendored
@@ -110,8 +110,7 @@ export async function retryTypedResponse<T>(
|
||||
statusCode: error.statusCode,
|
||||
result: null,
|
||||
headers: {},
|
||||
message: error.message,
|
||||
typeKey: error.result.typeKey
|
||||
error: error
|
||||
}
|
||||
} else {
|
||||
return undefined
|
||||
|
||||
Reference in New Issue
Block a user