@actions/artifact package (#304)

* Initial commit for @actions/artifact package
This commit is contained in:
Konrad Pabjan
2020-02-11 09:49:46 -05:00
committed by GitHub
parent 0ecc141d4e
commit 6cbb8e9bc8
19 changed files with 1802 additions and 0 deletions
@@ -0,0 +1,35 @@
export function getUploadFileConcurrency(): number {
return 2
}
export function getUploadChunkConcurrency(): number {
return 1
}
export function getUploadChunkSize(): number {
return 4 * 1024 * 1024 // 4 MB Chunks
}
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
}