Skip to content

Commit

Permalink
Error (as originally intended) when github token cannot be located
Browse files Browse the repository at this point in the history
  • Loading branch information
djspiewak committed Feb 20, 2020
1 parent 7ba9845 commit c6aad11
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/scala/sbtghpackages/GitHubPackagesPlugin.scala
Expand Up @@ -51,7 +51,17 @@ object GitHubPackagesPlugin extends AutoPlugin {

val authenticationSettings = Seq(
githubTokenSource := TokenSource.GitConfig("github.token"),
credentials += inferredGitHubCredentials(githubActor.value, githubTokenSource.value))

credentials += {
val src = githubTokenSource.value
inferredGitHubCredentials(githubActor.value, src) match {
case Some(creds) =>
creds

case None =>
sys.error(s"unable to locate a valid GitHub token from $src")
}
})

val packagePublishSettings = Seq(
publishTo := {
Expand Down

0 comments on commit c6aad11

Please sign in to comment.