diff --git a/github-actions/src/main/scala/org/typelevel/sbt/gha/WorkflowJob.scala b/github-actions/src/main/scala/org/typelevel/sbt/gha/WorkflowJob.scala index 8901148b..4d6173ec 100644 --- a/github-actions/src/main/scala/org/typelevel/sbt/gha/WorkflowJob.scala +++ b/github-actions/src/main/scala/org/typelevel/sbt/gha/WorkflowJob.scala @@ -60,7 +60,9 @@ sealed abstract class WorkflowJob { def withTimeoutMinutes(timeoutMinutes: Option[Int]): WorkflowJob def updatedEnv(name: String, value: String): WorkflowJob - def appendSteps(steps: List[WorkflowStep]): WorkflowJob + def concatEnv(envs: TraversableOnce[(String, String)]): WorkflowJob + def appendedStep(step: WorkflowStep): WorkflowJob + def concatStep(suffixSteps: TraversableOnce[WorkflowStep]): WorkflowJob } object WorkflowJob { @@ -153,8 +155,10 @@ object WorkflowJob { override def withConcurrency(concurrency: Option[Concurrency]): WorkflowJob = copy(concurrency = concurrency) override def withTimeoutMinutes(timeoutMinutes: Option[Int]): WorkflowJob = copy(timeoutMinutes = timeoutMinutes) - def updatedEnv(name: String, value: String): WorkflowJob = withEnv(env.updated(name, value)) - def appendSteps(steps: List[WorkflowStep]): WorkflowJob = withSteps(this.steps ++ steps) + def updatedEnv(name: String, value: String): WorkflowJob = copy(env = env.updated(name, value)) + def concatEnv(envs: TraversableOnce[(String, String)]): WorkflowJob = copy(env = this.env ++ envs) + def appendedStep(step: WorkflowStep): WorkflowJob = copy(steps = this.steps :+ step) + def concatStep(suffixSteps: TraversableOnce[WorkflowStep]): WorkflowJob = copy(steps = this.steps ++ suffixSteps) // scalafmt: { maxColumn = 96 } override def productPrefix = "WorkflowJob" diff --git a/github-actions/src/main/scala/org/typelevel/sbt/gha/WorkflowStep.scala b/github-actions/src/main/scala/org/typelevel/sbt/gha/WorkflowStep.scala index 65a787c0..9880f66d 100644 --- a/github-actions/src/main/scala/org/typelevel/sbt/gha/WorkflowStep.scala +++ b/github-actions/src/main/scala/org/typelevel/sbt/gha/WorkflowStep.scala @@ -30,7 +30,7 @@ sealed abstract class WorkflowStep extends Product with Serializable { def withTimeoutMinutes(minutes: Option[Int]): WorkflowStep def updatedEnv(name: String, value: String): WorkflowStep - def addEnv(env: Map[String, String]): WorkflowStep + def concatEnv(env: TraversableOnce[(String, String)]): WorkflowStep } object WorkflowStep { @@ -127,9 +127,9 @@ object WorkflowStep { def withWorkingDirectory(workingDirectory: Option[String]): Run def updatedEnv(name: String, value: String): Run - def addEnv(env: Map[String, String]): Run + def concatEnv(env: TraversableOnce[(String, String)]): Run def updatedParams(name: String, value: String): Run - def addParams(params: Map[String, String]): Run + def concatParams(params: TraversableOnce[(String, String)]): Run } object Run { @@ -167,9 +167,9 @@ object WorkflowStep { def withWorkingDirectory(workingDirectory: Option[String]) = copy(workingDirectory = workingDirectory) def updatedEnv(name: String, value: String) = copy(env = this.env.updated(name, value)) - def addEnv(env: Map[String, String]) = copy(env = this.env ++ env) + def concatEnv(env: TraversableOnce[(String, String)]) = copy(env = this.env ++ env) def updatedParams(name: String, value: String) = copy(params = this.params.updated(name, value)) - def addParams(params: Map[String, String]) = copy(params = this.params ++ params) + def concatParams(params: TraversableOnce[(String, String)]) = copy(params = this.params ++ params) // scalafmt: { maxColumn = 96 } } } @@ -184,9 +184,9 @@ object WorkflowStep { def withPreamble(preamble: Boolean): Sbt def updatedEnv(name: String, value: String): Sbt - def addEnv(env: Map[String, String]): Sbt + def concatEnv(env: TraversableOnce[(String, String)]): Sbt def updatedParams(name: String, value: String): Sbt - def addParams(params: Map[String, String]): Sbt + def concatParams(params: TraversableOnce[(String, String)]): Sbt } object Sbt { @@ -224,9 +224,9 @@ object WorkflowStep { def withPreamble(preamble: Boolean) = copy(preamble = preamble) def updatedEnv(name: String, value: String) = copy(env = this.env.updated(name, value)) - def addEnv(env: Map[String, String]) = copy(env = this.env ++ env) + def concatEnv(env: TraversableOnce[(String, String)]) = copy(env = this.env ++ env) def updatedParams(name: String, value: String) = copy(params = params.updated(name, value)) - def addParams(params: Map[String, String]) = copy(params = this.params ++ params) + def concatParams(params: TraversableOnce[(String, String)]) = copy(params = this.params ++ params) // scalafmt: { maxColumn = 96 } } } @@ -239,9 +239,9 @@ object WorkflowStep { def withParams(params: Map[String, String]): Use def updatedEnv(name: String, value: String): Use - def addEnv(env: Map[String, String]): Use + def concatEnv(env: TraversableOnce[(String, String)]): Use def updatedParams(name: String, value: String): Use - def addParams(params: Map[String, String]): Use + def concatParams(params: TraversableOnce[(String, String)]): Use } object Use { @@ -277,9 +277,9 @@ object WorkflowStep { def withParams(params: Map[String, String]) = copy(params = params) def updatedEnv(name: String, value: String) = copy(env = this.env.updated(name, value)) - def addEnv(env: Map[String, String]) = copy(env = this.env ++ env) + def concatEnv(env: TraversableOnce[(String, String)]) = copy(env = this.env ++ env) def updatedParams(name: String, value: String) = copy(params = params.updated(name, value)) - def addParams(params: Map[String, String]) = copy(params = this.params ++ params) + def concatParams(params: TraversableOnce[(String, String)]) = copy(params = this.params ++ params) // scalafmt: { maxColumn = 96 } } }