Skip to content

Commit

Permalink
Merge pull request #346 from tj-actions/feat/update-to-exclude-match-…
Browse files Browse the repository at this point in the history
…directory
  • Loading branch information
jackton1 committed Aug 23, 2022
2 parents 0193a0e + 2fccb2d commit 19a8227
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 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
5 changes: 4 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

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 19a8227

Please sign in to comment.