-
Notifications
You must be signed in to change notification settings - Fork 460
Description
Description:
I'd like to ability to apply a label only if the head branch matches all of the regexes in a list. This is typically because the first regex says the head branch must match a pattern, but the second regex says that the head branch should not match a different pattern i.e. exceptions to the first regex.
For example,
scala-steward:
- all:
- head-branch: ['^update\/.+', '^(?!^update\/user-service-gen$)']
Or another alternative, permit multiple head-branch's under the all condition:
scala-steward:
- all:
- head-branch: ['^update\/.+']
- head-branch: ['^(?!^update\/user-service-gen$)']
Another option, mirroring the all and any glob operators, would be to introduce a new all-head-branch operator, and rename the existing operator to any-head-branch.
scala-steward:
- all:
- all-head-branch: ['^update\/.+', '^(?!^update\/user-service-gen$)']
I have tested the first two options above, and in both cases it operates as the "any" logic i.e. a PR with head branch update/user-service-gen was labelled as it matched on the first regex condition. The second regex was not tested.
Justification:
Useful if you want to apply a label where the head-branch matches a regex, but with given exceptions.
It might be possible to do this within a single regex, but this feature would enable such functionality to be more easily understood.
Are you willing to submit a PR?
No, as I'm not a typescript developer, but I'd happily submit a PR to update the README if the feature was implemented.