Skip to content

Commit 3ce5a29

Browse files
remove: appending globstar pattern for directories to prevent bugs with path matching (#1670)
Co-authored-by: GitHub Action <[email protected]>
1 parent d898dd0 commit 3ce5a29

File tree

4 files changed

+7
-40
lines changed

4 files changed

+7
-40
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ And many more...
8888
> * For mono repositories where pulling all branch history might not be desired, you can still use the default [`fetch-depth`](https://github.com/actions/checkout#usage), which is set to `1` for `pull_request` events.
8989
> * Avoid using single or double quotes for multiline inputs, as the value is already a string separated by a newline character. See [Examples](#examples) for more information.
9090
> * If [`fetch-depth`](https://github.com/actions/checkout#usage) isn't set to `0`, ensure that [`persist-credentials`](https://github.com/actions/checkout#usage) is set to `true` when configuring [`actions/checkout`](https://github.com/actions/checkout#usage).
91+
> * For matching all files and folders under a directory you'll need to use `dir_name/**`
9192
9293
Visit the [discussions for more information](https://github.com/tj-actions/changed-files/discussions) or [create a new discussion](https://github.com/tj-actions/changed-files/discussions/new/choose) for usage-related questions.
9394

@@ -167,7 +168,7 @@ jobs:
167168
id: changed-files-specific
168169
uses: tj-actions/changed-files@v39
169170
with:
170-
files: docs/*.{js,html} # Alternatively using: `docs/**` or `docs`
171+
files: docs/*.{js,html} # Alternatively using: `docs/**`
171172
files_ignore: docs/static.js
172173

173174
- name: Run step if any file(s) in the docs folder change
@@ -553,7 +554,7 @@ See [outputs](#outputs) for a list of all available outputs.
553554
*.sh
554555
*.png
555556
!*.md
556-
test_directory
557+
test_directory/**
557558
**/*.sql
558559
...
559560
```
@@ -576,7 +577,7 @@ See [inputs](#inputs) for more information.
576577
*.sh
577578
*.png
578579
!*.md
579-
test_directory
580+
test_directory/**
580581
**/*.sql
581582
582583
- name: Run step if any of the listed files above change

dist/index.js

+1-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils.ts

+1-17
Original file line numberDiff line numberDiff line change
@@ -1008,23 +1008,7 @@ export const getFilePatterns = async ({
10081008

10091009
core.debug(`Input file patterns: ${filePatterns}`)
10101010

1011-
return filePatterns
1012-
.trim()
1013-
.split('\n')
1014-
.filter(Boolean)
1015-
.map(pattern => {
1016-
if (pattern.endsWith('/')) {
1017-
return `${pattern}**`
1018-
} else {
1019-
const pathParts = pattern.split('/')
1020-
const lastPart = pathParts[pathParts.length - 1]
1021-
if (!lastPart.includes('.') && !lastPart.endsWith('*')) {
1022-
return `${pattern}/**`
1023-
} else {
1024-
return pattern
1025-
}
1026-
}
1027-
})
1011+
return filePatterns.trim().split('\n').filter(Boolean)
10281012
}
10291013

10301014
// Example YAML input:

0 commit comments

Comments
 (0)