@@ -14,14 +14,15 @@ import (
1414)
1515
1616var (
17- flCommitRange = flag .String ("range" , "" , "use this commit range instead (implies -no-travis)" )
18- flListRules = flag .Bool ("list-rules" , false , "list the rules registered" )
19- flRun = flag .String ("run" , "" , "comma delimited list of rules to run. Defaults to all." )
20- flVerbose = flag .Bool ("v" , false , "verbose" )
21- flDebug = flag .Bool ("D" , false , "debug output" )
22- flQuiet = flag .Bool ("q" , false , "less output" )
23- flDir = flag .String ("d" , "." , "git directory to validate from" )
24- flNoTravis = flag .Bool ("no-travis" , false , "disables travis environment checks (when env TRAVIS=true is set)" )
17+ flCommitRange = flag .String ("range" , "" , "use this commit range instead (implies -no-travis)" )
18+ flListRules = flag .Bool ("list-rules" , false , "list the rules registered" )
19+ flRun = flag .String ("run" , "" , "comma delimited list of rules to run. Defaults to all." )
20+ flVerbose = flag .Bool ("v" , false , "verbose" )
21+ flDebug = flag .Bool ("D" , false , "debug output" )
22+ flQuiet = flag .Bool ("q" , false , "less output" )
23+ flDir = flag .String ("d" , "." , "git directory to validate from" )
24+ flNoTravis = flag .Bool ("no-travis" , false , "disables travis environment checks (when env TRAVIS=true is set)" )
25+ flTravisPROnly = flag .Bool ("travis-pr-only" , true , "when on travis, only run validations if the CI-Build is checking pull-request build" )
2526)
2627
2728func main () {
@@ -41,6 +42,11 @@ func main() {
4142 return
4243 }
4344
45+ if * flTravisPROnly && strings .ToLower (os .Getenv ("TRAVIS_PULL_REQUEST" )) == "false" {
46+ fmt .Printf ("only to check travis PR builds and this not a PR build. yielding.\n " )
47+ return
48+ }
49+
4450 // reduce the set being run
4551 rules := validate .RegisteredRules
4652 if * flRun != "" {
0 commit comments