Fixed dirname error

This commit is contained in:
Tonye Jack 2023-05-22 23:29:47 -06:00
parent f018002631
commit b63780f39c

View File

@ -2,6 +2,7 @@
import * as core from '@actions/core' import * as core from '@actions/core'
import * as exec from '@actions/exec' import * as exec from '@actions/exec'
import {MatchKind} from '@actions/glob/lib/internal-match-kind' import {MatchKind} from '@actions/glob/lib/internal-match-kind'
import { dirname } from "@actions/glob/lib/internal-path-helper";
import {Pattern} from '@actions/glob/lib/internal-pattern' import {Pattern} from '@actions/glob/lib/internal-pattern'
import * as patternHelper from '@actions/glob/lib/internal-pattern-helper' import * as patternHelper from '@actions/glob/lib/internal-pattern-helper'
@ -626,7 +627,7 @@ export const getDirnameMaxDepth = ({
dirNamesMaxDepth?: number dirNamesMaxDepth?: number
excludeRoot?: boolean excludeRoot?: boolean
}): string => { }): string => {
const pathArr = pathStr.split(path.sep) const pathArr = dirname(pathStr).split(path.sep)
const maxDepth = Math.min(dirNamesMaxDepth || pathArr.length, pathArr.length) const maxDepth = Math.min(dirNamesMaxDepth || pathArr.length, pathArr.length)
let output = pathArr[0] let output = pathArr[0]