From d0cf96f319c8061b4aa0777c29641c95dc5aa202 Mon Sep 17 00:00:00 2001 From: Bethany Date: Wed, 23 Aug 2023 06:47:51 -0700 Subject: [PATCH] Use options to specify download folder --- src/internal/download/download-artifact.ts | 4 ++-- src/internal/shared/interfaces.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/internal/download/download-artifact.ts b/src/internal/download/download-artifact.ts index a799539..c8bf2cd 100644 --- a/src/internal/download/download-artifact.ts +++ b/src/internal/download/download-artifact.ts @@ -56,8 +56,8 @@ export async function downloadArtifact( options?: DownloadArtifactOptions ): Promise { 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))) { diff --git a/src/internal/shared/interfaces.ts b/src/internal/shared/interfaces.ts index 4f9a5c4..d8132d7 100644 --- a/src/internal/shared/interfaces.ts +++ b/src/internal/shared/interfaces.ts @@ -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 } /*****************************************************************************