From 4946682b888503daaf8e7502a9915e7657f5788d Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 25 Aug 2022 23:16:23 -0600 Subject: [PATCH] feat: add support for configuring match directories --- __tests__/main.test.ts | 2 ++ action.yml | 4 ++++ src/main.ts | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index 74a355859..897752e94 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -9,6 +9,7 @@ const defaultEnv = { 'INPUT_EXCLUDED-FILES-SEPARATOR': '\n', 'INPUT_EXCLUDED-FILES-FROM-SOURCE-FILE-SEPARATOR': '\n', 'INPUT_FOLLOW-SYMBOLIC-LINKS': 'true', + 'INPUT_MATCH-DIRECTORIES': 'true', 'INPUT_ESCAPE-PATHS': 'false', INPUT_SEPARATOR: ' ', 'INPUT_STRIP-TOP-LEVEL-DIR': 'true', @@ -67,6 +68,7 @@ test('returns the paths of the all other files (input files)', async () => { 'jest.config.js', 'package.json', 'renovate.json', + 'src', 'src/cleanup.ts', 'src/utils.ts', 'tsconfig.json', diff --git a/action.yml b/action.yml index e4bbaef93..e8d225f5a 100644 --- a/action.yml +++ b/action.yml @@ -37,6 +37,10 @@ inputs: description: 'Indicates whether to follow symbolic links' default: "true" required: true + match-directories: + description: 'Indicates whether to include match directories' + default: "true" + required: true separator: description: 'Separator used for the paths output.' required: true diff --git a/src/main.ts b/src/main.ts index 5296e823e..a1ac984d9 100644 --- a/src/main.ts +++ b/src/main.ts @@ -49,6 +49,9 @@ export async function run(): Promise { const followSymbolicLinks = core.getBooleanInput('follow-symbolic-links', { required: false }) + const matchDirectories = core.getBooleanInput('match-directories', { + required: false + }) const separator = core.getInput('separator', { required: true, trimWhitespace: false @@ -153,7 +156,7 @@ export async function run(): Promise { const globOptions: GlobOptions = { followSymbolicLinks, - matchDirectories: false + matchDirectories } const globber = await glob.create(filePatterns, globOptions) let paths = await globber.glob()