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

@@ -26,3 +26,11 @@ export function isGhes(): boolean {
)
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM'
}
export function getGitHubWorkspaceDir(): string {
const ghWorkspaceDir = process.env['GITHUB_WORKSPACE']
if (!ghWorkspaceDir) {
throw new Error('Unable to get the GITHUB_WORKSPACE env variable')
}
return ghWorkspaceDir
}