Links

Custom validations

Aviator also supports validating the PR title and description. This can be achieved using custom validation in preconditions. For instance, if you want to require each PR title to have a ticket number, or if you have a checklist of items in the body, you can setup the preconditions:
preconditions:
validations:
- name: Require JIRA ticket in title
match:
type: title
regex:
- '^\[AVT\-\d+\].+$'
- name: Require tests have been run checkbox
match:
type: body
regex:
- '^\[x\] All relevant tests have been run$'
- name: Require documentation checkbox
match:
type: body
regex:
- '^\[x\] The documentation has been updated$'
Using this now, Aviator will look for a PR title starting with “[AVT-”, and would require the body to have the following two checks marked as done:
[x] All relevant tests have been run
[x] The documentation has been updated
When the checks fail, you will see the “name” of the validation reported in the comment as failure, blocking the PR from getting queued: