From 9a01ddca95ae0e18b28fa657d40dad2d48e129d6 Mon Sep 17 00:00:00 2001 From: John Sudol <24583161+johnsudol@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:01:27 +0000 Subject: [PATCH] parse the root Dir path --- packages/artifact/src/internal/upload-specification.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/artifact/src/internal/upload-specification.ts b/packages/artifact/src/internal/upload-specification.ts index 68468c4d..9594e17a 100644 --- a/packages/artifact/src/internal/upload-specification.ts +++ b/packages/artifact/src/internal/upload-specification.ts @@ -1,6 +1,6 @@ import * as fs from 'fs' import {debug} from '@actions/core' -import {join, normalize, resolve} from 'path' +import {join, normalize, resolve, parse} from 'path' import {checkArtifactFilePath} from './path-and-artifact-name-validation' export interface UploadSpecification { @@ -22,7 +22,9 @@ export function getUploadSpecification( // artifact name was checked earlier on, no need to check again const specifications: UploadSpecification[] = [] - if (!fs.existsSync(rootDirectory)) { + const rootPath = parse(rootDirectory).dir; + + if (!fs.existsSync(rootPath)) { throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`) } if (!fs.lstatSync(rootDirectory).isDirectory()) {