feat: add dir_names_exclude_current_dir input and cleaned up logic to retrieve the current sha (#1229)
Co-authored-by: GitHub Action <action@github.com> Co-authored-by: tj-actions[bot] <109116665+tj-actions-bot@users.noreply.github.com> Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
This commit is contained in:
@@ -642,11 +642,11 @@ export const canDiffCommits = async ({
|
||||
export const getDirnameMaxDepth = ({
|
||||
pathStr,
|
||||
dirNamesMaxDepth,
|
||||
excludeRoot
|
||||
excludeCurrentDir
|
||||
}: {
|
||||
pathStr: string
|
||||
dirNamesMaxDepth?: number
|
||||
excludeRoot?: boolean
|
||||
excludeCurrentDir?: boolean
|
||||
}): string => {
|
||||
const pathArr = dirname(pathStr).split(path.sep)
|
||||
const maxDepth = Math.min(dirNamesMaxDepth || pathArr.length, pathArr.length)
|
||||
@@ -656,7 +656,7 @@ export const getDirnameMaxDepth = ({
|
||||
output = path.join(output, pathArr[i])
|
||||
}
|
||||
|
||||
if (excludeRoot && output === '.') {
|
||||
if (excludeCurrentDir && output === '.') {
|
||||
return ''
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user