travis: fix DCO validation for merges
merged PRs do not have DCO, so do not check for them Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
3f62423765
commit
041eb73d2e
|
@ -16,6 +16,12 @@ import (
|
|||
var DefaultRules = []ValidateRule{
|
||||
func(c CommitEntry) (vr ValidateResult) {
|
||||
vr.CommitEntry = c
|
||||
if len(strings.Split(c.Parent, " ")) > 1 {
|
||||
vr.Pass = true
|
||||
vr.Msg = "merge commits do not require DCO"
|
||||
return vr
|
||||
}
|
||||
|
||||
hasValid := false
|
||||
for _, line := range strings.Split(c.Body, "\n") {
|
||||
if validDCO.MatchString(line) {
|
||||
|
@ -70,7 +76,7 @@ func main() {
|
|||
fmt.Println("PASS")
|
||||
if *flVerbose {
|
||||
for _, r := range vr {
|
||||
if !r.Pass {
|
||||
if r.Pass {
|
||||
fmt.Printf(" - %s\n", r.Msg)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue