Skip to main content
Version: 2.x

Control CI Concurrency

By default one run per branch is kept and in-progress runs are cancelled. cancelInProgress accepts an expression as well as a boolean, which is what lets a workflow cancel superseded pull request runs while letting releases finish:

import zio.sbt.githubactions.{CancelInProgress, Concurrency, Condition}

ciConcurrency := Some(
Concurrency(
group = "ci-pr-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref }}",
cancelInProgress = CancelInProgress.When(Condition.Expression("github.event_name == 'pull_request'"))
)
)

Individual jobs can override it. A release should generally not be cancelled halfway through:

Job(
id = "release",
name = "Release",
concurrency = Some(
Concurrency(group = "release-${{ github.ref }}", cancelInProgress = CancelInProgress.Never)
),
steps = ...
)

ZIO Chat

๐Ÿ”ฅ Ignite your ZIO journey with ZIO Chat! ๐Ÿ”ฅ Ready to unravel the intricacies of ZIO? As your trusty sidekick, I'm here to light the way. No matter if you're wandering through functional forests or traversing effectful landscapes, I've got answers to keep you on track. Your ZIO adventure starts here โ€“ ask me anything and let's explore together!