use GITHUB_WORKSPACE as default download dir

This commit is contained in:
Bethany
2023-08-22 11:44:38 -07:00
parent dd26bb1149
commit 671bf1ebd5
2 changed files with 10 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ import {
DownloadArtifactResponse
} from '../shared/interfaces'
import {getUserAgentString} from '../shared/user-agent'
import { getGitHubWorkspaceDir } from '../shared/config'
const scrubQueryParameters = (url: string): string => {
const parsed = new URL(url)
@@ -54,7 +55,7 @@ export async function downloadArtifact(
token: string,
options?: DownloadArtifactOptions
): Promise<DownloadArtifactResponse> {
let downloadPath = options?.path || process.cwd() // TODO: make this align with GITHUB_WORKSPACE
let downloadPath = options?.path || getGitHubWorkspaceDir()
if (options?.createArtifactFolder) {
downloadPath = path.join(downloadPath, 'my-artifact') // TODO: need to pass artifact name
}