Skip to content

Commit d08ad8e

Browse files
authored
Merge pull request #861 from zarthross/cancel-in-progress
2 parents aa89a0d + 06c2edd commit d08ad8e

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

‎github-actions/mima.sbt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ mimaBinaryIssueFilters ++= Seq(
66
"org.typelevel.sbt.gha.WorkflowStep#Sbt.*",
77
"org.typelevel.sbt.gha.WorkflowStep#Run.*",
88
"org.typelevel.sbt.gha.WorkflowStep#Use.*",
9-
"org.typelevel.sbt.gha.Permissions#Specify.*"
9+
"org.typelevel.sbt.gha.Permissions#Specify.*",
10+
"org.typelevel.sbt.gha.Concurrency.*"
1011
).map(ProblemFilters.exclude[ReversedMissingMethodProblem](_))

‎github-actions/src/main/scala/org/typelevel/sbt/gha/Concurrency.scala‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,28 @@ package org.typelevel.sbt.gha
1818

1919
sealed abstract class Concurrency {
2020
def group: String
21-
def cancelInProgress: Option[Boolean]
21+
def cancelInProgressExpr: Option[String]
22+
23+
@deprecated("Use cancelInProgressExpr", "0.8.5")
24+
def cancelInProgress: Option[Boolean] = cancelInProgressExpr match {
25+
case Some("false") => Some(false)
26+
case Some("true") => Some(true)
27+
case _ => None
28+
}
2229
}
2330

2431
object Concurrency {
32+
def apply(group: String, cancelInProgress: Boolean): Concurrency =
33+
apply(group, Some(cancelInProgress))
2534

2635
def apply(group: String, cancelInProgress: Option[Boolean] = None): Concurrency =
36+
Impl(group, cancelInProgress.map(_.toString))
37+
38+
def apply(group: String, cancelInProgress: Option[String])(
39+
implicit dummy: DummyImplicit): Concurrency =
2740
Impl(group, cancelInProgress)
2841

29-
private final case class Impl(group: String, cancelInProgress: Option[Boolean])
42+
private final case class Impl(group: String, cancelInProgressExpr: Option[String])
3043
extends Concurrency {
3144
override def productPrefix = "Concurrency"
3245
}

‎github-actions/src/main/scala/org/typelevel/sbt/gha/GenerativePlugin.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ object GenerativePlugin extends AutoPlugin {
173173
}
174174

175175
def compileConcurrency(concurrency: Concurrency): String =
176-
concurrency.cancelInProgress match {
176+
concurrency.cancelInProgressExpr match {
177177
case Some(value) =>
178178
val fields = s"""group: ${wrap(concurrency.group)}
179179
|cancel-in-progress: ${wrap(value.toString)}""".stripMargin

0 commit comments

Comments
 (0)