labeler
labeler copied to clipboard
Bug: Similar glob combinations will cause no files to match
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']