mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2025-08-21 05:39:07 +08:00
Use options to specify download folder
This commit is contained in:
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…
x
Reference in New Issue
Block a user