diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml index e4a23ef..b4cfb05 100644 --- a/.github/workflows/scala.yml +++ b/.github/workflows/scala.yml @@ -8,17 +8,15 @@ on: jobs: build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 11 - uses: actions/setup-java@v4 - with: - java-version: '11' - distribution: 'adopt' - - name: Run tests - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: sbt test + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + - name: Run tests + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: sbt test diff --git a/app/controllers/HomeController.scala b/app/controllers/HomeController.scala index 353b496..7184a35 100644 --- a/app/controllers/HomeController.scala +++ b/app/controllers/HomeController.scala @@ -28,7 +28,6 @@ class HomeController @Inject()( cache: SyncCacheApi ) extends AbstractController(cc) { - private val accessToken = configuration.get[String]("accessToken") private val organization = configuration.get[String]("githubOrganisation") private val repository = configuration.get[String]("githubRepository") private val branch = configuration.get[String]("githubBranch") @@ -123,7 +122,7 @@ class HomeController @Inject()( } else { cache.get(post.authorName) match { case None => - val getUser = Github(Option(accessToken)).users.get(post.authorName).execFuture[HttpResponse[String]]() + val getUser = Github().users.get(post.authorName).execFuture[HttpResponse[String]]() getUser.map { case Left(_) => Ok(views.html.post(post)) case Right(re) => diff --git a/app/modules/ApplicationStart.scala b/app/modules/ApplicationStart.scala index 3d2f9fc..bbcdfa0 100644 --- a/app/modules/ApplicationStart.scala +++ b/app/modules/ApplicationStart.scala @@ -24,12 +24,11 @@ class ApplicationStart @Inject()( cache: SyncCacheApi ) { - private val accessToken = configuration.get[String]("accessToken") private val organization = configuration.get[String]("githubOrganisation") private val repository = configuration.get[String]("githubRepository") private val branch = configuration.get[String]("githubBranch") - private def getContents = Github(Option(accessToken)).repos.getContents(organization, repository, "posts", Option(branch)).execFuture[HttpResponse[String]]() + private def getContents = Github().repos.getContents(organization, repository, "posts", Option(branch)).execFuture[HttpResponse[String]]() { // Parse all and put into cache @@ -108,7 +107,7 @@ class ApplicationStart @Inject()( val authorName = post.authorName cache.get(authorName) match { case None => - val getUser = Github(Option(accessToken)).users.get(authorName).execFuture[HttpResponse[String]]() + val getUser = Github().users.get(authorName).execFuture[HttpResponse[String]]() val postWithAuthor = getUser.map { case Left(_) => p case Right(rUser) => diff --git a/conf/application.conf b/conf/application.conf index 69cdb04..f74cf1e 100644 --- a/conf/application.conf +++ b/conf/application.conf @@ -1,7 +1,6 @@ # https://www.playframework.com/documentation/latest/Configuration # Github configuration -accessToken = ${?access_token} githubOrganisation = lunatech-labs githubOrganisation = ${?github_organisation} githubRepository = lunatech-blog diff --git a/project/build.properties b/project/build.properties index 0b699c3..db1723b 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.10.2 +sbt.version=1.10.5