Skip to content

Commit

Permalink
Restores old encoding (#730)
Browse files Browse the repository at this point in the history
  • Loading branch information
fedefernandez committed Jan 4, 2023
1 parent ce84c12 commit 0168fd3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ lazy val pluginSettings: Seq[Def.Setting[_]] = Seq(
"net.jcazevedo" %% "moultingyaml" % "0.4.2",
"com.lihaoyi" %% "scalatags" % "0.12.0",
"com.sksamuel.scrimage" %% "scrimage-scala" % "4.0.32",
"com.github.marklister" %% "base64" % "0.3.0",
"org.scalatest" %% "scalatest" % "3.2.14" % Test,
"org.scalatestplus" %% "scalacheck-1-15" % "3.2.11.0" % Test
),
Expand Down
3 changes: 2 additions & 1 deletion project/dependencies.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ libraryDependencies ++= Seq(
"org.http4s" %% "http4s-blaze-client" % "0.23.13",
"net.jcazevedo" %% "moultingyaml" % "0.4.2",
"com.lihaoyi" %% "scalatags" % "0.12.0",
"com.sksamuel.scrimage" %% "scrimage-scala" % "4.0.32"
"com.sksamuel.scrimage" %% "scrimage-scala" % "4.0.32",
"com.github.marklister" %% "base64" % "0.3.0"
)
11 changes: 2 additions & 9 deletions src/main/scala/microsites/github/GitHubOps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import cats.data.{NonEmptyList, OptionT}
import cats.effect.{Ref => _, _}
import cats.effect.kernel.Temporal
import cats.implicits._
import com.github.marklister.base64.Base64._
import github4s._
import github4s.domain._
import microsites.Exceptions._
Expand Down Expand Up @@ -115,15 +116,7 @@ class GitHubOps[F[_]: Async: Temporal](
): F[TreeDataSha] =
for {
gh <- ghWithRateLimit
res <- run(
gh.gitData.createBlob(
owner,
repo,
Base64.getEncoder().encode(array).mkString(""),
Some("base64"),
headers
)
)
res <- run(gh.gitData.createBlob(owner, repo, array.toBase64, Some("base64"), headers))
.map(refInfo => TreeDataSha(filePath, blobMode, blobType, refInfo.sha))
} yield res

Expand Down

0 comments on commit 0168fd3

Please sign in to comment.