pekko/project/GitHub.scala
Arnout Engelen d703a2afe0
'master' to 'main' (#30714)
* 'master' to 'main'

* Repo reference in docs

* Found another in the issue template
2021-09-25 09:39:36 +02:00

23 lines
591 B
Scala

/*
* Copyright (C) 2016-2021 Lightbend Inc. <https://www.lightbend.com>
*/
package akka
object 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")) "main" else "v" + v
"https://github.com/akka/akka/tree/" + branch
}
}