Files
toolkit/packages/artifact/src/internal/config-variables.ts
T

68 lines
2.0 KiB
TypeScript
Raw Normal View History

2020-04-08 16:55:18 +02:00
// The number of concurrent uploads that happens at the same time
2020-02-11 09:49:46 -05:00
export function getUploadFileConcurrency(): number {
return 2
}
2020-04-08 16:55:18 +02:00
// When uploading large files that can't be uploaded with a single http call, this controls
// the chunk size that is used during upload
2020-02-11 09:49:46 -05:00
export function getUploadChunkSize(): number {
return 8 * 1024 * 1024 // 8 MB Chunks
2020-02-11 09:49:46 -05:00
}
2020-04-08 16:55:18 +02:00
// The maximum number of retries that can be attempted before an upload or download fails
export function getRetryLimit(): number {
return 5
2020-02-13 18:24:11 -05:00
}
2020-04-08 16:55:18 +02:00
// With exponential backoff, the larger the retry count, the larger the wait time before another attempt
// The retry multiplier controls by how much the backOff time increases depending on the number of retries
export function getRetryMultiplier(): number {
return 1.5
2020-03-12 14:50:27 +01:00
}
2020-04-08 16:55:18 +02:00
// The initial wait time if an upload or download fails and a retry is being attempted for the first time
export function getInitialRetryIntervalInMilliseconds(): number {
return 3000
}
// The number of concurrent downloads that happens at the same time
2020-03-12 14:50:27 +01:00
export function getDownloadFileConcurrency(): number {
return 2
2020-02-13 18:24:11 -05:00
}
2020-02-11 09:49:46 -05:00
export function getRuntimeToken(): string {
const token = process.env['ACTIONS_RUNTIME_TOKEN']
if (!token) {
throw new Error('Unable to get ACTIONS_RUNTIME_TOKEN env variable')
}
return token
}
export function getRuntimeUrl(): string {
const runtimeUrl = process.env['ACTIONS_RUNTIME_URL']
if (!runtimeUrl) {
throw new Error('Unable to get ACTIONS_RUNTIME_URL env variable')
}
return runtimeUrl
}
export function getWorkFlowRunId(): string {
const workFlowRunId = process.env['GITHUB_RUN_ID']
if (!workFlowRunId) {
throw new Error('Unable to get GITHUB_RUN_ID env variable')
}
return workFlowRunId
}
2020-02-13 18:24:11 -05:00
export function getWorkSpaceDirectory(): string {
const workspaceDirectory = process.env['GITHUB_WORKSPACE']
if (!workspaceDirectory) {
throw new Error('Unable to get GITHUB_WORKSPACE env variable')
}
return workspaceDirectory
}
export function getRetentionDays(): string | undefined {
return process.env['GITHUB_RETENTION_DAYS']
}