when: labelling rules, convention rules, requested and automatic approvals, and stale.exempt.when.
requires defaults to the number of conditions, so without it every condition must pass. With requires: 1 any one is enough.
Field names are the same as v1 (type, condition, requires, label, min, max), so v1 conditions work unchanged.
Patterns
Conditions that match text take a pattern: a regular expression written either bare (^feat) or delimited with flags (/^feat/i). An invalid pattern is rejected when the config is loaded, not on the first event.
filesMatch is the exception: it takes a glob such as docs/** or **/*.md.
Conditions
Activity is GitHub’s
updated_at time for the issue or pull request.
Reviews count each reviewer’s latest decisive review: comments and pending reviews do not change an earlier approval or change request.
Pull request only conditions
branchMatches, isDraft, filesMatch, changesSize, pendingReview, requestedChanges, isApproved, commitMessagesMatch, commitsSignedOff and hasTrailer only apply to pull requests. On an issue they fail, with the explanation “only applies to pull requests”.
Commit conditions
commitMessagesMatch, commitsSignedOff and hasTrailer ignore merge commits. scope is all (the default: every commit must match) or any (at least one must).
Trailers are read the way git reads them: only from the final paragraph of the message, with keys compared ignoring case. A message with a single paragraph has no trailers, so a subject such as feat: add x is never read as a trailer.
Combinators
Combinators nest condition groups.$not also accepts the two forms v1 wrote: a one-item list holding the group, or the conditions inline with requires on the $not itself.
Explanations
Every condition produces a one-line explanation, such astitle does not match ^feat or 3 changed line(s). The conventions feature uses these to say why a rule failed when the rule has no message of its own.