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
|
||||
): Promise<DownloadArtifactResponse> {
|
||||
let downloadPath = options?.path || getGitHubWorkspaceDir()
|
||||
if (options?.createArtifactFolder) {
|
||||
downloadPath = path.join(downloadPath, 'my-artifact') // TODO: need to pass artifact name
|
||||
if (options?.createArtifactFolderName) {
|
||||
downloadPath = path.join(downloadPath, options?.createArtifactFolderName)
|
||||
}
|
||||
|
||||
if (!(await exists(downloadPath))) {
|
||||
|
|
|
@ -93,10 +93,10 @@ export interface DownloadArtifactOptions {
|
|||
path?: string
|
||||
|
||||
/**
|
||||
* Specifies if a root folder with the artifact name is created for the artifact that is downloaded
|
||||
* Zip contents are expanded into this folder. Defaults to false if not specified
|
||||
* Specifies if a root folder with the given name is created for the artifact that is downloaded
|
||||
* 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