1
0
Fork 0

Use options to specify download folder

pull/1503/head
Bethany 2023-08-23 06:47:51 -07:00
parent 6adf053d36
commit ced07aa89c
2 changed files with 5 additions and 5 deletions

View File

@ -56,8 +56,8 @@ export async function downloadArtifact(
options?: DownloadArtifactOptions options?: DownloadArtifactOptions
): Promise<DownloadArtifactResponse> { ): Promise<DownloadArtifactResponse> {
let downloadPath = options?.path || getGitHubWorkspaceDir() let downloadPath = options?.path || getGitHubWorkspaceDir()
if (options?.createArtifactFolder) { if (options?.createArtifactFolderName) {
downloadPath = path.join(downloadPath, 'my-artifact') // TODO: need to pass artifact name downloadPath = path.join(downloadPath, options?.createArtifactFolderName)
} }
if (!(await exists(downloadPath))) { if (!(await exists(downloadPath))) {

View File

@ -93,10 +93,10 @@ export interface DownloadArtifactOptions {
path?: string path?: string
/** /**
* Specifies if a root folder with the artifact name is created for the artifact that is downloaded * Specifies if a root folder with the given name is created for the artifact that is downloaded
* Zip contents are expanded into this folder. Defaults to false if not specified * Zip contents are expanded into this folder. A folder will not be created if not specified.
* */ * */
createArtifactFolder?: boolean createArtifactFolderName?: string
} }
/***************************************************************************** /*****************************************************************************