github: add mergeable config (#3008)

This PR causes mergeable to enforce the following rules on PRs:

- must include a "Type:" label
- must include either the "no release notes" label or a Release milestone
This commit is contained in:
Doug Fawley 2019-09-05 15:47:27 -07:00 committed by GitHub
parent 5735d6dcf1
commit 74f33a446d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 36 additions and 0 deletions

36
.github/mergeable.yml vendored Normal file
View File

@ -0,0 +1,36 @@
version: 2
mergeable:
- when: pull_request.*
validate:
- do: label
must_include:
regex: '^Type:'
fail:
- do: checks
status: 'failure'
payload:
title: 'Need an appropriate "Type:" label'
summary: 'Need an appropriate "Type:" label'
- when: pull_request.*
# This validator requires either the "no release notes" label OR a "Release" milestone
# to be considered successful. However, validators "pass" in mergeable only if all
# checks pass. So it is implemented in reverse.
# I.e.: !(!no_relnotes && !release_milestone) ==> no_relnotes || release_milestone
# If both validators pass, then it is considered a failure, and if either fails, it is
# considered a success.
validate:
- do: label
must_exclude:
regex: '^no release notes$'
- do: milestone
must_exclude:
regex: 'Release$'
pass:
- do: checks
status: 'failure' # fail on pass
payload:
title: 'Need Release milestone or "no release notes" label'
summary: 'Need Release milestone or "no release notes" label'
fail:
- do: checks
status: 'success' # pass on fail