From ced07aa89c5da3cec1848b9424dcce8c85607ba0 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 --- .../artifact/src/internal/download/download-artifact.ts | 4 ++-- packages/artifact/src/internal/shared/interfaces.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index a799539e..c8bf2cd3 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/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/packages/artifact/src/internal/shared/interfaces.ts b/packages/artifact/src/internal/shared/interfaces.ts index 4f9a5c43..d8132d7b 100644 --- a/packages/artifact/src/internal/shared/interfaces.ts +++ b/packages/artifact/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 } /*****************************************************************************