Switched to new sbt pr validator plugin (#25264)

* Switched to new sbt PR validator plugin
* Moved root setting of additionalTasks to global scope
* Upgraded to version 1.0 of pull request validator
This commit is contained in:
James Roper 2019-01-15 12:23:27 +11:00 committed by Helena Edelson
parent 00b235d9c5
commit ab82924a84
4 changed files with 44 additions and 244 deletions

View file

@ -6,10 +6,14 @@ package akka
object GitHub {
def envTokenOrThrow: String =
sys.env.getOrElse(
"PR_VALIDATOR_GH_TOKEN",
throw new Exception("No PR_VALIDATOR_GH_TOKEN env var provided, unable to reach github!"))
def envTokenOrThrow: Option[String] =
sys.env.get("PR_VALIDATOR_GH_TOKEN") orElse {
if (sys.env.contains("ghprbPullId")) {
throw new Exception("No PR_VALIDATOR_GH_TOKEN env var provided during GitHub Pull Request Builder build, unable to reach GitHub!")
} else {
None
}
}
def url(v: String): String = {
val branch = if (v.endsWith("SNAPSHOT")) "master" else "v" + v