diff --git a/build.sbt b/build.sbt index c9ea9f82..dd3756df 100644 --- a/build.sbt +++ b/build.sbt @@ -10,8 +10,7 @@ name := "codacy-coverage-reporter" // Runtime dependencies libraryDependencies ++= Seq( "com.github.alexarchambault" %% "case-app" % "2.1.0-M26", - "org.wvlet.airframe" %% "airframe-log" % "22.3.0", - "com.lihaoyi" %% "ujson" % "1.5.0" + "org.wvlet.airframe" %% "airframe-log" % "22.3.0" ) // Test dependencies diff --git a/src/main/scala/com/codacy/rules/commituuid/providers/GitHubActionProvider.scala b/src/main/scala/com/codacy/rules/commituuid/providers/GitHubActionProvider.scala index 9c1713ed..adb7bb97 100644 --- a/src/main/scala/com/codacy/rules/commituuid/providers/GitHubActionProvider.scala +++ b/src/main/scala/com/codacy/rules/commituuid/providers/GitHubActionProvider.scala @@ -5,6 +5,7 @@ import java.nio.file.Files import com.codacy.model.configuration.CommitUUID import com.codacy.rules.commituuid.CommitUUIDProvider +import play.api.libs.json._ import wvlet.log.LazyLogger import scala.util.Try @@ -53,12 +54,12 @@ object GitHubActionProvider extends CommitUUIDProvider with LazyLogger { private def extractHeadSHA(eventName: String, eventContent: String) = { Try { - val eventJson = ujson.read(eventContent) + val eventJson = Json.parse(eventContent) eventName match { case "workflow_run" => - eventJson(eventName)("head_sha").str + (eventJson \ eventName \ "head_sha").as[String] case _ => - eventJson(eventName)("head")("sha").str + (eventJson \ eventName \ "head" \ "sha").as[String] } }.toEither.left.map(t => s"Unable to fetch SHA from event file. Failed with error: ${t.getMessage}") }