labeler icon indicating copy to clipboard operation
labeler copied to clipboard

Bug: Similar glob combinations will cause no files to match

Open davidparsson opened this issue 2 years ago • 0 comments

When having a labeler.yml where patterns may be expanded to match similar file patterns, none of those will be matched.

Consider the following labeler.yml:

'some-label':
 - 'something*.txt'
 - 'something/**/*.txt'

Modifying something_anything.txt or something/anything.txt in a PR will not add the label, which I would expect. The Minimatch glob matcher (labeler.ts#L203) will find multiple globs that both cannot be fulfilled. If this is expected I think clarifications in the documentation is needed.

The workaround I've found is to specify multiple any blocks:

'some-label':
 - any: ['something*.txt']
 - any: ['something/**/*.txt']

davidparsson avatar Jul 08 '22 07:07 davidparsson