labeler icon indicating copy to clipboard operation
labeler copied to clipboard

Support negative conditions

Open chubchenko opened this issue 4 years ago • 1 comments

Hi, first of all, thanks for that solution 🙏

In one of my repositories, I would like to define a list of available branch types. And if someone created a branch and has opened a PR with a name that does not match any conditions I would like to add an unknown label.

I tried to do that via my own conditions

- label: "unknown"
  branch: "^((?!feature|bugfix).)*$"

but then realize that it does not work since Go regex does not support ?! 😞

chubchenko avatar Sep 07 '21 09:09 chubchenko

Thanks @chubchenko, I'll try to get this done sometime soon, but PRs are welcome!

srvaroa avatar Sep 14 '21 13:09 srvaroa

Hi @chubchenko since this is a limitation in Go's regex library I've tried an imperfect workaround. I'm interested in knowing if this would cover your use case: https://github.com/srvaroa/labeler/pull/67

srvaroa avatar Feb 20 '23 18:02 srvaroa

Workaround merged, please refer to: https://github.com/srvaroa/labeler#negate-rules, let me know if this solves this use case. Will be released in v1.3

srvaroa avatar Feb 20 '23 22:02 srvaroa

@srvaroa Thank you very much

chubchenko avatar Feb 22 '23 16:02 chubchenko