mirror of https://github.com/actions/toolkit
Use options to specify download folder
parent
6adf053d36
commit
ced07aa89c
|
@ -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))) {
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
Loading…
Reference in New Issue