Skip to content

Commit

Permalink
Support Basic Auth for GitHub again
Browse files Browse the repository at this point in the history
  • Loading branch information
joan38 authored and mzuehlke committed Nov 21, 2024
1 parent 26c80c7 commit f289203
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:

- uses: coursier/setup-action@v1
with:
apps: scalafmt
apps: 'scalafmt:3.8.3'

- name: Build project
run: sbt '++ ${{ matrix.scala }}' validate
Expand Down
6 changes: 4 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ ThisBuild / githubWorkflowPublish := Seq(
ThisBuild / githubWorkflowJavaVersions := Seq("21", "17", "11").map(JavaSpec(Temurin, _))
ThisBuild / githubWorkflowBuild :=
Seq(
WorkflowStep
.Use(UseRef.Public("coursier", "setup-action", "v1"), params = Map("apps" -> "scalafmt")),
WorkflowStep.Use(
UseRef.Public("coursier", "setup-action", "v1"),
params = Map("apps" -> "scalafmt:3.8.3")
),
WorkflowStep.Sbt(List("validate"), name = Some("Build project")),
WorkflowStep.Use(
UseRef.Public("codecov", "codecov-action", "v3"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,15 @@ object ForgeAuthAlg {
config.gitCfg.gitAskPass
)
case GitHub =>
val gitHub =
config.githubApp.getOrElse(
throw new IllegalArgumentException("GitHub app configuration is missing")
)
new GitHubAuthAlg(config.forgeCfg.apiHost, gitHub.id, gitHub.keyFile)
config.githubApp match {
case Some(gitHub) => new GitHubAuthAlg(config.forgeCfg.apiHost, gitHub.id, gitHub.keyFile)
case None =>
new BasicAuthAlg(
config.forgeCfg.apiHost,
config.forgeCfg.login,
config.gitCfg.gitAskPass
)
}
case GitLab =>
new GitLabAuthAlg(config.forgeCfg.apiHost, config.forgeCfg.login, config.gitCfg.gitAskPass)
case Gitea =>
Expand Down

0 comments on commit f289203

Please sign in to comment.