-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more with*
, update*
, and add*
for Workflow step and jobs.
#732
Conversation
I think these methods are useful. I'm not certain about the naming conventions. T equivalent methods on the underlying collections use past tense e.g. |
@armanbilge |
@@ -149,6 +152,9 @@ object WorkflowJob { | |||
override def withEnvironment(environment: Option[JobEnvironment]): WorkflowJob = copy(environment = environment) | |||
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method name append
is inconsistent (in both name and signature) with appended
. https://www.scala-lang.org/api/current/scala/collection/immutable/List.html#appended-957
(Although it looks like the 2.12 standard library doesn't have named aliases for these methods.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed append
to appended
and made it take a single step. Added concatStep
with a TraversableOnce
for added flexibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also changed add*
to concat*
for consistency.
github-actions/src/main/scala/org/typelevel/sbt/gha/WorkflowJob.scala
Outdated
Show resolved
Hide resolved
github-actions/src/main/scala/org/typelevel/sbt/gha/WorkflowJob.scala
Outdated
Show resolved
Hide resolved
Co-authored-by: Arman Bilge <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for iterating!
Not sure how often and when these will be used, but I found wanting another with, so I took the time to add some more helpers.