Skip to content

Commit

Permalink
chore: make sbt-github-packages plugin optional
Browse files Browse the repository at this point in the history
Make the plugin optional again
The environment variable GITHUB_TOKEN it's no longer requirement
  • Loading branch information
FabioPinheiro committed Jan 23, 2024
1 parent 32b6542 commit 2c2e2bf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,16 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-gzip" % "1.0.2")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.3.0")

// Github Packages
addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.3")
if (sys.env.get("GITHUB_TOKEN").isDefined) {
println(s"Adding plugin sbt-dependency-tree since env GITHUB_TOKEN is defined.")
// The reason for this is that the plugin needs the variable to be defined. We don't want to have that requirement.
libraryDependencies += {
val dependency = "com.codecommit" % "sbt-github-packages" % "0.5.3"
val sbtV = (pluginCrossBuild / sbtBinaryVersion).value
val scalaV = (update / scalaBinaryVersion).value
Defaults.sbtPluginExtra(dependency, sbtV, scalaV)
}
} else libraryDependencies ++= Seq[ModuleID]()

// Native Packager
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.16")

0 comments on commit 2c2e2bf

Please sign in to comment.