Skip to content

Commit a7eaaa5

Browse files
committed
format
1 parent 7982525 commit a7eaaa5

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

sbt-plugin/src/main/scala/ch/epfl/scala/SubmitDependencyGraph.scala

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ object SubmitDependencyGraph {
7979
val storeAllManifests = scalaVersions.flatMap { scalaVersion =>
8080
Seq(s"++$scalaVersion", s"Global/${githubStoreDependencyManifests.key} $scalaVersion")
8181
}
82-
val commands = storeAllManifests :+ { if (local) { SubmitInternalLocal } else { SubmitInternal } }
82+
val commands = storeAllManifests :+ {
83+
if (local) { SubmitInternalLocal }
84+
else { SubmitInternal }
85+
}
8386
commands.toList ::: initState
8487
}
8588

@@ -104,24 +107,24 @@ object SubmitDependencyGraph {
104107
"Content-Type" -> "application/json",
105108
"Authorization" -> s"token ${githubToken()}"
106109
)
107-
state.log.info(s"Submiting dependency snapshot of job ${snapshot.job} to $snapshotUrl")
108-
val result = for {
109-
httpResp <- Try(Await.result(http.processFull(request), Duration.Inf))
110-
snapshot <- getSnapshot(httpResp)
111-
} yield {
112-
state.log.info(s"Submitted successfully as $snapshotUrl/${snapshot.id}")
113-
setGithubOutputs(
114-
"submission-id" -> s"${snapshot.id}",
115-
"submission-api-url" -> s"${snapshotUrl}/${snapshot.id}",
116-
"snapshot-json-path" -> snapshotJsonFile.getAbsolutePath
117-
)
118-
state
119-
}
120-
result.get
121-
} else {
122-
state.log.info(s"Local mode: skipping submission")
110+
state.log.info(s"Submiting dependency snapshot of job ${snapshot.job} to $snapshotUrl")
111+
val result = for {
112+
httpResp <- Try(Await.result(http.processFull(request), Duration.Inf))
113+
snapshot <- getSnapshot(httpResp)
114+
} yield {
115+
state.log.info(s"Submitted successfully as $snapshotUrl/${snapshot.id}")
116+
setGithubOutputs(
117+
"submission-id" -> s"${snapshot.id}",
118+
"submission-api-url" -> s"${snapshotUrl}/${snapshot.id}",
119+
"snapshot-json-path" -> snapshotJsonFile.getAbsolutePath
120+
)
123121
state
124122
}
123+
result.get
124+
} else {
125+
state.log.info(s"Local mode: skipping submission")
126+
state
127+
}
125128

126129
}
127130

@@ -200,7 +203,7 @@ object SubmitDependencyGraph {
200203
private def githubToken(local: Boolean = false): String = githubCIEnv("GITHUB_TOKEN", local)
201204
private def githubOutput(local: Boolean = false): String = githubCIEnv("GITHUB_OUTPUT", local)
202205

203-
private def githubCIEnv(name: String, local : Boolean = false): String =
206+
private def githubCIEnv(name: String, local: Boolean = false): String =
204207
Properties.envOrNone(name).getOrElse {
205208
if (local) ""
206209
else throw new MessageOnlyException(s"Missing environment variable $name. This task must run in a Github Action.")

0 commit comments

Comments
 (0)