Skip to content

Commit

Permalink
feat: update to exclude match directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Aug 23, 2022
1 parent 0193a0e commit 68608c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion __tests__/main.test.ts
Expand Up @@ -58,7 +58,7 @@ test('returns the paths of the filtered files (input files, input source files)'
test('returns the paths of the all other files (input files)', async () => {
mockedEnv({
...defaultEnv,
INPUT_FILES: '!__tests__\n!*.md\n!dist\n!jest\n!.*\n!src\n!lib',
INPUT_FILES: '!__tests__\n!*.md\n!dist\n!jest\n!.*\n!src/main.ts\n!lib',
})

const EXPECTED_FILENAMES = [
Expand All @@ -67,6 +67,8 @@ test('returns the paths of the all other files (input files)', async () => {
'jest.config.js',
'package.json',
'renovate.json',
'src/cleanup.ts',
'src/utils.ts',
'tsconfig.json',
'yarn.lock'
]
Expand Down
6 changes: 5 additions & 1 deletion src/main.ts
@@ -1,3 +1,4 @@
import {GlobOptions} from '@actions/glob'
import * as path from 'path'
import * as core from '@actions/core'
import * as glob from '@actions/glob'
Expand Down Expand Up @@ -150,7 +151,10 @@ export async function run(): Promise<void> {
filePatterns = `**\n${filePatterns}`
}

const globOptions = {followSymbolicLinks}
const globOptions: GlobOptions = {
followSymbolicLinks,
matchDirectories: false
}
const globber = await glob.create(filePatterns, globOptions)
let paths = await globber.glob()

Expand Down

0 comments on commit 68608c9

Please sign in to comment.