-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax for complex combinations of conditions #7
Comments
We could support syntax similar to MongoDB query operators https://docs.mongodb.com/manual/reference/operator/query/ {
"type": "SOME_TYPE",
"pattern": "SOME_PATTERN"
} We could use following syntax {
"pr": {
"bugfix": {
"requires": 1,
"conditions": {
"$and": [
{
"type": "branchMatches",
"pattern": "^bugfix"
},
{
"$or": [
{
"type": "titleMatches",
"pattern": "bugfix"
},
{
"$not": {
"type": "titleMatches",
"pattern": "feature"
}
}
]
}
]
}
}
}
} For backwards compatibility we could support |
That's a good idea! Do you have any use cases for this already? I think I'm going to backlog this one until users needs it. |
I don't have a use case yet, but I didn't start using this action. We will see soon :D |
Ok I thing I see a use case for that, for |
+1 would love to have. for instance I've got the following check which I would love to override by using a simple {
"issue": {
"confirmed": {
"requires": 1,
"conditions": {
"$or": [
{
"$and": [
{
"type": "descriptionMatches",
"pattern": "/^- \\[x\\] bug Confirmed by (@.*& .*){4,}/im"
},
{
"type": "descriptionMatches",
"pattern": "/^- \\[x\\] have reproduced on my application version/im"
},
{
"type": "descriptionMatches",
"pattern": "/^- \\[x\\] have reproduced on clean installation/im"
},
{
"type": "descriptionMatches",
"pattern": "/^- \\[x\\] have reproduced on development build/im"
},
{
"type": "descriptionMatches",
"pattern": "/^- \\[x\\] have included logs or screenshots/im"
},
{
"type": "descriptionMatches",
"pattern": "/^- \\[x\\] have contacted support/im"
},
{
"type": "descriptionMatches",
"pattern": "/^- \\[x\\] have asked the community/im"
},
{
"type": "descriptionMatches",
"pattern": "/^- \\[x\\] have linked any related/im"
}
]
},
{
"type": "descriptionMatches",
"pattern": "/^- \\[x\\] bug Confirmed by (@.*& )*@(tgtgamer|videndum\\/.*)/im"
}
]
}
}
}
} |
Finally got round to adding this to my version of the labelled. Will soon push to #24 so people can use it |
Currently, when you want to match multiple conditions, you can only specify how many need to match. A different syntax could allow you to specify more complex combinations using and, or, not, etc. operators.
I'm not sure what this would look like, and I'm not sure what it would look. It may not be useful enough to warrant the complexity.
The text was updated successfully, but these errors were encountered: