labeler
labeler copied to clipboard
Some regex not working in filter via property
i need to filter some changed files in specific directory but the applied regex not working even I tested on https://regex101.com/
- label: "payment"
files:
- "feature/wallet/.*"
- "(.*?)\/(addressbook|travelrules|walletsigning)\/.*"
I am having the same issue and it only happens on the files property
@mytrancoinhako, @Mar0xy: As this GitHub Action is written in Go (Golang), handling regular expressions (Regex) requires a bit of extra care. Specifically, you'll need to escape special characters using double backslashes. This is because the backslash in Go strings is an escape character and therefore must be escaped itself. Here's an example that should work:
- label: "File"
files:
- ".*\\/subfolder\\/.*\\.md"
To clarify this, I've submitted PR (#129) that updates the documentation accordingly.
Thanks @philippwaller , a while back I added this note to the docs on this topic, it has a link to https://regex101.com with the golang flavour which is needed to match the behaviour in the action. The tests and docs update made by @philippwaller should make this clearer.
I will close this issue for now but let me know if the issue is solved for you.
Related to/duplicate of #105