mirror of
https://github.com/actions/toolkit.git
synced 2026-08-23 00:00:19 +02:00
28 lines
696 B
TypeScript
28 lines
696 B
TypeScript
|
|||
|
|
import {checkArtifactName} from './path-and-artifact-name-validation'
|
||
|
|
import {UploadOptions} from './upload-options'
|
||
|
|
import {UploadResponse} from './upload-response'
|
||
|
|
|
||
|
|
export async function uploadArtifact(
|
||
|
|
name: string,
|
||
|
|
files: string[],
|
||
|
|
rootDirectory: string,
|
||
|
|
options?: UploadOptions | undefined
|
||
|
|
): Promise<UploadResponse> {
|
||
|
|
|
||
|
|
// Need to keep checking the artifact name
|
||
|
|
checkArtifactName(name)
|
||
|
|
|
||
|
|
// TODO Twirp call to create new artifact
|
||
|
|
|
||
|
|
// TODO Upload to blob storage using SAS URL
|
||
|
|
|
||
|
|
// TODO Twirp call to finalize the new artifact upload
|
||
|
|
|
||
|
|
const uploadResponse: UploadResponse = {
|
||
|
|
artifactName: name,
|
||
|
|
size: 0
|
||
|
|
}
|
||
|
|
|
||
|
|
return uploadResponse
|
||
|
|
}
|